function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def samefile(self, repo_file, ext_file): if self.hard: if os.path.islink(ext_file): return False if not os.path.exists(repo_file): return False return filecmp.cmp(repo_file, ext_file, shallow=False) else: # not using os.same...
Cube777/dotgit
[ 158, 13, 158, 2, 1451246258 ]
def __init__(self, key): """ Set the key to be used for en-/de-cryption. """ self.twofish = twofish.Twofish() self.twofish.set_key(key)
hupf/passwordchest
[ 4, 1, 4, 7, 1255897186 ]
def decrypt(self, ciphertext): """ Decrypt the given string using Twofish ECB. """ if len(ciphertext) % 16: raise RuntimeError("Twofish ciphertext length must be a multiple of 16") plaintext = "" while len(ciphertext) >= 16: plaintext += self.twofi...
hupf/passwordchest
[ 4, 1, 4, 7, 1255897186 ]
def parse_version(version): match = VERSION_RE.match(version) if not match: return None, None, 0 ver = match.group(3) rel = match.group(4) if match.group(2): epoch = int(match.group(2)) else: epoch = 0 return ver, rel, epoch
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def get_split_packages_info(): '''Return info on split packages that do not have an actual package name matching the split pkgbase.''' pkgnames = Package.objects.values('pkgname') split_pkgs = Package.objects.exclude(pkgname=F('pkgbase')).exclude( pkgbase__in=pkgnames).values('pkgbase', 'repo', ...
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def __init__(self, pkgname, repo, pkg_a, pkg_b): self.pkgname = pkgname self.repo = repo self.pkg_a = pkg_a self.pkg_b = pkg_b
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def __key(self): return (self.pkgname, hash(self.repo), hash(self.pkg_a), hash(self.pkg_b))
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def __hash__(self): return hash(self.__key())
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def get_wrong_permissions(): sql = """
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def attach_maintainers(packages): '''Given a queryset or something resembling it of package objects, find all the maintainers and attach them to the packages to prevent N+1 query cascading.''' if isinstance(packages, QuerySet): pkgbases = packages.values('pkgbase') else: packages = l...
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def __init__(self, packages): if len(packages) == 0: raise Exception self.packages = packages self.user = None self.target_repo = None self.signoffs = set() self.default_spec = True first = packages[0] self.pkgbase = first.pkgbase self...
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def package(self): '''Try and return a relevant single package object representing this group. Start by seeing if there is only one package, then look for the matching package by name, finally falling back to a standin package object.''' if len(self.packages) == 1: re...
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def find_specification(self, specifications): for spec in specifications: if spec.pkgbase != self.pkgbase: continue if self.version and not spec.full_version == self.version: continue if spec.arch_id == self.arch.id and spec.repo_id == self.rep...
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def completed(self): return sum(1 for s in self.signoffs if not s.revoked)
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def required(self): return self.specification.required
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def __unicode__(self): return f'{self.pkgbase}-{self.version} (self.arch): {len(self.signoffs)}'
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def get_current_signoffs(repos): '''Returns a list of signoff objects for the given repos.''' to_fetch = signoffs_id_query(Signoff, repos) return Signoff.objects.select_related('user').in_bulk(to_fetch).values()
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def get_target_repo_map(repos): sql = """
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def get_signoff_groups(repos=None, user=None): if repos is None: repos = Repo.objects.filter(testing=True) repo_ids = [r.pk for r in repos] test_pkgs = Package.objects.select_related( 'arch', 'repo', 'packager').filter(repo__in=repo_ids) packages = test_pkgs.order_by('pkgname') pack...
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def default(self, obj): if hasattr(obj, '__iter__'): # mainly for queryset serialization return list(obj) if isinstance(obj, Package): data = {attr: getattr(obj, attr) for attr in self.pkg_attributes} for attr in self.pkg_list_attributes: d...
archlinux/archweb
[ 270, 117, 270, 77, 1370983197 ]
def __init__(self,id): self.id=id self.taxable=1 self.price=simple_items[id][2] self.name=simple_items[id][0] self.label=simple_items[id][1] self.taxable=True try: self.taxable=simple_items[id][3]["taxable"] except: pass
johm/infoshopkeeper
[ 8, 3, 8, 3, 1323614202 ]
def getPrice(self): return self.price
johm/infoshopkeeper
[ 8, 3, 8, 3, 1323614202 ]
def getName(self): return self.name
johm/infoshopkeeper
[ 8, 3, 8, 3, 1323614202 ]
def getLabel(self): return self.label
johm/infoshopkeeper
[ 8, 3, 8, 3, 1323614202 ]
def addToOrder(self): return 0
johm/infoshopkeeper
[ 8, 3, 8, 3, 1323614202 ]
def removeFromOrder(self): return 0
johm/infoshopkeeper
[ 8, 3, 8, 3, 1323614202 ]
def finalizeOrder(self,cursor,cashier,paid_how): cursor.execute (""" INSERT INTO transactionLog SET action = "SALE", amount = %s, cashier = %s, date = NOW(), info = %s,
johm/infoshopkeeper
[ 8, 3, 8, 3, 1323614202 ]
def getUVs(object, particle_system): """ returns a numpy-array of uv - coordinates for a given particle-system on a given object """ locations = [p.location for p in object.particle_systems[particle_system].particles] uvs = [pam.map3dPointToUV(object, object, loc) for loc in locations] return np.ar...
MartinPyka/Parametric-Anatomical-Modeling
[ 11, 6, 11, 5, 1432640367 ]
def export_connections(filepath): """Export connection and distance-informations :param str filepath: export filename .. note:: * cmatrices: list of connection matrices * dmatrices: list of distance matrices * nglist: list of neural groups * connection_list: list of layer-b...
MartinPyka/Parametric-Anatomical-Modeling
[ 11, 6, 11, 5, 1432640367 ]
def export_UVfactors(filepath, uv_matrices, layer_names): """Export UV-matrices, including the length of a real edge an its UV-distance :param str filename: export filename :param numpy.Array uv_matrices: :param list layer_names: .. note:: * uv_matrices: list of uv-matrices * l...
MartinPyka/Parametric-Anatomical-Modeling
[ 11, 6, 11, 5, 1432640367 ]
def csv_write_matrices(file, suffix, matrices): """Write matrices to csv file :param file file: open file :param str suffix: suffix for filename :param list matrices: a list of matrices """ for i, matrix in enumerate(matrices): output = io.StringIO() writer = csv.writer( ...
MartinPyka/Parametric-Anatomical-Modeling
[ 11, 6, 11, 5, 1432640367 ]
def poll(cls, context): return any(model.MODEL.connections)
MartinPyka/Parametric-Anatomical-Modeling
[ 11, 6, 11, 5, 1432640367 ]
def register(): """Call upon module register""" bpy.utils.register_class(PAMModelExportCSV)
MartinPyka/Parametric-Anatomical-Modeling
[ 11, 6, 11, 5, 1432640367 ]
def main(): """Main thresholdmon program""" parser = make_option_parser() (_options, _args) = parser.parse_args() init_generic_logging( logfile=LOG_FILE, stderr=False, stdout=True, read_config=True, ) django.setup() scan()
UNINETT/nav
[ 131, 35, 131, 187, 1484647509 ]
def scan(): """Scans for threshold rules and evaluates them""" rules = ThresholdRule.objects.all() alerts = get_unresolved_threshold_alerts() _logger.info("evaluating %d rules", len(rules)) for rule in rules: evaluate_rule(rule, alerts) _logger.info("done")
UNINETT/nav
[ 131, 35, 131, 187, 1484647509 ]
def evaluate_rule(rule, alerts): """ Evaluates the current status of a single rule and posts events if necessary. """ _logger.debug("evaluating rule %r", rule) evaluator = rule.get_evaluator() try: if not evaluator.get_values(): _logger.warning( "did not ...
UNINETT/nav
[ 131, 35, 131, 187, 1484647509 ]
def start_event(rule, metric, value): """Makes and posts a threshold start event""" event = make_event(True, rule, metric, value) _logger.debug("posted start event: %r", event) return event
UNINETT/nav
[ 131, 35, 131, 187, 1484647509 ]
def make_event(start, rule, metric, value): """Makes and posts a threshold event""" event = _event_template() event.state = event.STATE_START if start else event.STATE_END event.subid = "{rule}:{metric}".format(rule=rule.id, metric=metric) varmap = dict(metric=metric, alert=rule.alert, ...
UNINETT/nav
[ 131, 35, 131, 187, 1484647509 ]
def _event_template(): event = Event() event.source_id = 'thresholdMon' event.target_id = 'eventEngine' event.event_type_id = 'thresholdState' return event
UNINETT/nav
[ 131, 35, 131, 187, 1484647509 ]
def __init__(self, conn=None, object_path=None, bus_name=None): super(BaseFacts, self).__init__(conn=conn, object_path=object_path, bus_name=bus_name) # Default is an empty FactsCollector self.facts_collector = self.facts_collector_class()
candlepin/subscription-manager
[ 59, 108, 59, 16, 1337271210 ]
def GetFacts(self, sender=None): collection = self.facts_collector.collect() cleaned = dict([(str(key), str(value)) for key, value in list(collection.data.items())]) return dbus.Dictionary(cleaned, signature="ss")
candlepin/subscription-manager
[ 59, 108, 59, 16, 1337271210 ]
def __init__(self, conn=None, object_path=None, bus_name=None): super(self.__class__, self).__init__(conn=conn, object_path=object_path, bus_name=bus_name) self.facts_collector = facts_collector
candlepin/subscription-manager
[ 59, 108, 59, 16, 1337271210 ]
def check_origin(self, origin): """ Prevents CORS attacks. Args: origin: HTTP "Origin" header. URL of initiator of the request. Returns: True if origin is legit, otherwise False """ # FIXME: implement CORS checking return True
zetaops/zengine
[ 82, 22, 82, 36, 1424353885 ]
def open(self): """ Called on new websocket connection. """ sess_id = self._get_sess_id() if sess_id: self.application.pc.websockets[self._get_sess_id()] = self self.write_message(json.dumps({"cmd": "status", "status": "open"})) else: s...
zetaops/zengine
[ 82, 22, 82, 36, 1424353885 ]
def on_close(self): """ remove connection from pool on connection close. """ self.application.pc.unregister_websocket(self._get_sess_id())
zetaops/zengine
[ 82, 22, 82, 36, 1424353885 ]
def _handle_headers(self): """ Do response processing """ origin = self.request.headers.get('Origin') if not settings.DEBUG: if origin in settings.ALLOWED_ORIGINS or not origin: self.set_header('Access-Control-Allow-Origin', origin) else: ...
zetaops/zengine
[ 82, 22, 82, 36, 1424353885 ]
def get(self, view_name): """ only used to display login form Args: view_name: should be "login" """ self.post(view_name)
zetaops/zengine
[ 82, 22, 82, 36, 1424353885 ]
def post(self, view_name): """ login handler """ sess_id = None input_data = {} # try: self._handle_headers() # handle input input_data = json_decode(self.request.body) if self.request.body else {} input_data['path'] = view_name #...
zetaops/zengine
[ 82, 22, 82, 36, 1424353885 ]
def runserver(host=None, port=None): """ Run Tornado server """ host = host or os.getenv('HTTP_HOST', '0.0.0.0') port = port or os.getenv('HTTP_PORT', '9001') zioloop = ioloop.IOLoop.instance() # setup pika client: pc = QueueManager(zioloop) app.pc = pc pc.connect() app.list...
zetaops/zengine
[ 82, 22, 82, 36, 1424353885 ]
def _valida_codice_fiscale(codice_fiscale): """ Validatore esteso che verifica che il codice fiscale sia valido. Se il codice fiscale e' temporaneo (11 cifre numeriche), e' considerato valido. :param codice_fiscale: Il codice fiscale. :return: None. Exception in caso di validazione. """ try:...
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def ottieni_genere_da_codice_fiscale(codice_fiscale, default=None): try: return codicefiscale.get_gender(codice_fiscale) except: return default
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def _validatore(fieldfile_obj): filesize = fieldfile_obj.file.size megabyte_limit = mb if filesize > megabyte_limit*1024*1024: raise ValidationError("Seleziona un file più piccolo di %sMB" % str(megabyte_limit))
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def valida_partita_iva(partita_iva): try: return stdnum.it.iva.validate(partita_iva) except: raise ValidationError("Partita IVA non corretta.")
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def valida_dimensione_file_5mb(fieldfile_obj): filesize = fieldfile_obj.file.size megabyte_limit = 5 if filesize > megabyte_limit*1024*1024: raise ValidationError("Seleziona un file più piccolo di %sMB" % str(megabyte_limit))
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def valida_dimensione_file_8mb(fieldfile_obj): filesize = fieldfile_obj.file.size megabyte_limit = 8 if filesize > megabyte_limit*1024*1024: raise ValidationError("Seleziona un file più piccolo di %sMB" % str(megabyte_limit))
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def valida_email_personale(email): coppie = ( ('cl.', '@cri.it'), ('cp.', '@cri.it'), ('cr.', '@cri.it'), ) for coppia in coppie: if email and email.lower().startswith(coppia[0]) and email.lower().endswith(coppia[1]): raise ValidationError("Non è possibile utilizz...
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def __init__(self, filesize=2): self.filesize = filesize
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def get_full_sequence_threaded(worker,current_color,deepness): sequence=get_full_sequence(worker,current_color,deepness) threading.current_thread().sequence=sequence
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def run_analysis(self,current_move):
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def play(self,gtp_color,gtp_move):#GnuGo needs to redifine this method to apply it to all its workers if gtp_color=='w': self.bot.place_white(gtp_move) for worker in self.workers: worker.place_white(gtp_move) else: self.bot.place_black(gtp_move) for worker in self.workers: worker.place_black(gtp...
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def undo(self): self.bot.undo() for worker in self.workers: worker.undo()
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def terminate_bot(self): log("killing gnugo") self.gnugo.close() log("killing gnugo workers") for w in self.workers: w.close()
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def gnugo_starting_procedure(sgf_g,profile,silentfail=False): return bot_starting_procedure("GnuGo","GNU Go",GnuGo_gtp,sgf_g,profile,silentfail)
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def __init__(self,parent,filename,move_range,intervals,variation,komi,profile="slow",existing_variations="remove_everything"): RunAnalysisBase.__init__(self,parent,filename,move_range,intervals,variation,komi,profile,existing_variations)
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def __init__(self,g,filename,profile="slow"): LiveAnalysisBase.__init__(self,g,filename,profile)
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def get_gnugo_initial_influence_black(self): self.write("initial_influence black influence_regions") one_line=self.readline() one_line=one_line.split("= ")[1].strip().replace(" "," ") lines=[one_line] for i in range(self.size-1): one_line=self.readline().strip().replace(" "," ") lines.append(one_line)
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def get_gnugo_initial_influence_white(self): self.write("initial_influence white influence_regions") one_line=self.readline() one_line=one_line.split("= ")[1].strip().replace(" "," ") lines=[one_line] for i in range(self.size-1): one_line=self.readline().strip().replace(" "," ") lines.append(one_line)
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def quick_evaluation(self,color): return variation_data_formating["ES"]%self.get_gnugo_estimate_score()
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def get_gnugo_estimate_score(self): self.write("estimate_score") answer=self.readline().strip() try: return answer[2:] except: raise GRPException("GRPException in get_gnugo_estimate_score()")
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def gnugo_top_moves_black(self): self.write("top_moves_black") answer=self.readline()[:-1] try: answer=answer.split(" ")[1:-1] except: raise GRPException("GRPException in get_gnugo_top_moves_black()") answers_list=[] for value in answer: try: float(value) except: answers_list.append(valu...
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def get_gnugo_experimental_score(self,color): self.write("experimental_score "+color) answer=self.readline().strip() return answer[2:]
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def __init__(self,parent,bot="GnuGo"): Frame.__init__(self,parent) self.parent=parent self.bot=bot self.profiles=get_bot_profiles(bot,False) profiles_frame=self
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def clear_selection(self): self.index=-1 self.profile.set("") self.command.set("") self.parameters.set("") self.variations.set("") self.deepness.set("")
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def add_profile(self): profiles=self.profiles if self.profile.get()=="": return data={"bot":self.bot} data["profile"]=self.profile.get() data["command"]=self.command.get() data["parameters"]=self.parameters.get() data["variations"]=self.variations.get() data["deepness"]=self.deepness.get()
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def modify_profile(self): profiles=self.profiles if self.profile.get()=="": return
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def __init__(self,sgf_g,profile): BotOpenMove.__init__(self,sgf_g,profile) self.name='Gnugo' self.my_starting_procedure=gnugo_starting_procedure
pnprog/goreviewpartner
[ 268, 66, 268, 59, 1484372321 ]
def test_empty(): parsed = parsing._parse_requirement(io.StringIO(""" """)) assert parsed == {}
PyAr/fades
[ 192, 43, 192, 14, 1416192244 ]
def test_simple_default(): parsed = parsing._parse_requirement(io.StringIO(""" foo """)) assert parsed == {REPO_PYPI: get_reqs('foo')}
PyAr/fades
[ 192, 43, 192, 14, 1416192244 ]
def test_version_same(): parsed = parsing._parse_requirement(io.StringIO(""" pypi::foo == 3.5 """)) assert parsed == { REPO_PYPI: get_reqs('foo == 3.5') }
PyAr/fades
[ 192, 43, 192, 14, 1416192244 ]
def test_version_different(): parsed = parsing._parse_requirement(io.StringIO(""" foo !=3.5 """)) assert parsed == { REPO_PYPI: get_reqs('foo !=3.5') }
PyAr/fades
[ 192, 43, 192, 14, 1416192244 ]
def test_version_greater_two_spaces(): parsed = parsing._parse_requirement(io.StringIO(""" foo > 2 """)) assert parsed == { REPO_PYPI: get_reqs('foo > 2') }
PyAr/fades
[ 192, 43, 192, 14, 1416192244 ]
def test_comments(): parsed = parsing._parse_requirement(io.StringIO(""" pypi::foo # some text # other text bar """)) assert parsed == { REPO_PYPI: get_reqs('foo') + get_reqs('bar') }
PyAr/fades
[ 192, 43, 192, 14, 1416192244 ]
def test_vcs_simple(): parsed = parsing._parse_requirement(io.StringIO(""" vcs::strangeurl """)) assert parsed == {REPO_VCS: [parsing.VCSDependency("strangeurl")]}
PyAr/fades
[ 192, 43, 192, 14, 1416192244 ]
def main(): """Start here""" parser = make_parser() args = parser.parse_args() if args.version: from lintswitch import __version__ print(__version__) return 0 log_params = {'level': args.loglevel} if args.logfile: log_params['filename'] = args.logfile loggi...
grahamking/lintswitch
[ 26, 5, 26, 4, 1291506173 ]
def main_loop(listener, work_queue): """Wait for connections and process them. @param listener: a socket.socket, open and listening. """ while True: conn, _ = listener.accept() data = conn.makefile().read() conn.close() work_queue.put(data)
grahamking/lintswitch
[ 26, 5, 26, 4, 1291506173 ]
def find(name): """Finds a program on system path.""" for directory in syspath(): candidate = os.path.join(directory, name) if os.path.exists(candidate): return candidate return None
grahamking/lintswitch
[ 26, 5, 26, 4, 1291506173 ]
def getDocumentMD5(self): return hashlib.md5(str(self.incoterm)).hexdigest()
stanta/darfchain
[ 10, 15, 10, 2, 1496296948 ]
def get_ethereum_addres(self): ethereum_address = self.env['setting.connect'].search([('platforma','=','ethereum')]) result_ethereum_dic = {} if ethereum_address: result_ethereum_dic.update({'ethereum_address':ethereum_address[0].ethereum_pk, '...
stanta/darfchain
[ 10, 15, 10, 2, 1496296948 ]
def _gas_for_signature(self): ethereum_setting = {} if self.get_ethereum_addres()[0].keys() == {}: result_of_gas_estimate = 0 else: date_of_synchronization = dt.now() ethereum_setting = self.get_ethereum_addres() ethereum_setting = ethereum_setting...
stanta/darfchain
[ 10, 15, 10, 2, 1496296948 ]
def _gas_limit(self): ethereum_setting = {} if self.get_ethereum_addres()[0].keys() == {}: result_of_gas_limit = 0 else: ethereum_setting = self.get_ethereum_addres() ethereum_setting = ethereum_setting[0] web3 = Web3(HTTPProvider(ethereum_setting[...
stanta/darfchain
[ 10, 15, 10, 2, 1496296948 ]
def signature_action(self): ethereum_setting = {} date_of_synchronization = dt.now() ethereum_setting = {} ethereum_setting = self.get_ethereum_addres() ethereum_setting = ethereum_setting[0] web3 = Web3(HTTPProvider(ethereum_setting['address_node'])) abi_json = e...
stanta/darfchain
[ 10, 15, 10, 2, 1496296948 ]
def check_signature_action(self): date_of_synchronization = dt.now() ethereum_setting = self.get_ethereum_addres() ethereum_setting = ethereum_setting[0] web3 = Web3(HTTPProvider(ethereum_setting['address_node'])) abi_json = ethereum_setting['ethereum_interface'] ethereum...
stanta/darfchain
[ 10, 15, 10, 2, 1496296948 ]
def fetch_production(zone_key='NL', session=None, target_datetime=None, logger=logging.getLogger(__name__), energieopwek_nl=True): if target_datetime is None: target_datetime = arrow.utcnow() else: target_datetime = arrow.get(target_datetime) r = session or requests.sess...
corradio/electricitymap
[ 2764, 774, 2764, 221, 1463848577 ]
def fetch_production_energieopwek_nl(session=None, target_datetime=None, logger=logging.getLogger(__name__)): if target_datetime is None: target_datetime = arrow.utcnow() # Get production values for target and target-1 day df_current = get_production_data_energi...
corradio/electricitymap
[ 2764, 774, 2764, 221, 1463848577 ]
def _fromUtf8(s): return s
Alexsays/Kindle-Sync
[ 2, 1, 2, 1, 1395888753 ]
def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig, _encoding)
Alexsays/Kindle-Sync
[ 2, 1, 2, 1, 1395888753 ]
def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig)
Alexsays/Kindle-Sync
[ 2, 1, 2, 1, 1395888753 ]
def __init__(self, parent=None, flags=QtCore.Qt.Dialog): super(Ui_SearchDialog, self).__init__(parent, flags) self.setupUi(self)
Alexsays/Kindle-Sync
[ 2, 1, 2, 1, 1395888753 ]
def closeClicked(self): print "clicked" self.closeSignal.emit()
Alexsays/Kindle-Sync
[ 2, 1, 2, 1, 1395888753 ]
def main(): repos_file, beaker_file = parse_args() repos = load_secret_data(repos_file) inject_repos(repos, beaker_file)
oVirt/jenkins
[ 16, 9, 16, 6, 1366658775 ]