Skip to content

Instantly share code, notes, and snippets.

import subprocess
import glob
import re
def type_lines(ll_files):
for ll_file in ll_files:
for line in open(ll_file):
if line.startswith('%'):
yield line
use quickcheck::*;
use fasthash::MetroHasher;
use itertools::Itertools;
use im_rc::hashset::HashSet;
fn make_std_set(items: &[i32]) -> std::collections::HashSet<i32> {
items.iter().cloned().collect()
}
fn make_set(items: &[i32]) -> HashSet<i32, MyHasher> {
extern crate itertools;
extern crate linked_hash_set;
use itertools::Itertools;
use std::collections::HashMap;
use std::collections::HashSet;
use linked_hash_set::LinkedHashSet;
#[derive(Debug, Copy, Clone)]
enum OpType {
#![allow(unused_imports)]
extern crate regex;
#[macro_use]
extern crate lazy_static;
extern crate itertools;
extern crate pbr;
extern crate colored;
use std::collections::VecDeque;
use itertools::Itertools;
use pbr::ProgressBar;
start
test_mock (test_upload.UploaderTest) ... FAIL
NoneType: None
======================================================================
FAIL: test_mock (test_upload.UploaderTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/mock.py", line 1191, in patched
return func(*args, **keywargs)
use std::fs::File;
use pbr::ProgressBar;
use std::io::Read;
pub struct ProgressFile {
file: File,
progress: ProgressBar<::std::io::Stdout>,
}
impl ProgressFile {
10000000 1381753 V2WUU2
10000000 221103 A0A0W0FIN8
10000001 1381753 V2XGB0
10000001 221103 A0A0W0F6P5
1000000 192259 S8BUG6
10000002 1381753 V2XRT4
10000002 221103 A0A0W0F264
10000003 1381753 V2WQU0
10000003 221103 A0A0W0EWU1
10000004 1381753 V2XU54
isPosix = os.name == 'posix'
isNt = os.name == 'nt'
isWin9x = os.name == 'win9x'
isMac = os.name == 'macos'
if isPosix:
do_posix_version()
elif isNt:
do_window_version()
elif isWin9x:
NotEmptyList<T> getItems(); // always has at least one element.
List<T> maybeGetItems(); // might have zero elements.
T average(NotEmptyList<T> items) {
T value = 0;
for (T item: items.get()) {
value += item;
}
return value / items.get().size();
}
#include <stdlib.h>
#include <string.h>
#define false 0
#define true 1
typedef int bool;
bool error(int depth) {
if(depth == 0) {
return true;