max_stars_repo_path
stringlengths
4
286
max_stars_repo_name
stringlengths
5
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.03M
content_cleaned
stringlengths
6
1.03M
language
stringclasses
111 values
language_score
float64
0.03
1
comments
stringlengths
0
556k
edu_score
float64
0.32
5.03
edu_int_score
int64
0
5
openff/bespokefit/executor/services/qcgenerator/cache.py
openforcefield/bespoke-f
12
600
import hashlib from typing import TypeVar, Union import redis from openff.toolkit.topology import Molecule from openff.bespokefit.executor.services.qcgenerator import worker from openff.bespokefit.schema.tasks import HessianTask, OptimizationTask, Torsion1DTask from openff.bespokefit.utilities.molecule import canonic...
import hashlib from typing import TypeVar, Union import redis from openff.toolkit.topology import Molecule from openff.bespokefit.executor.services.qcgenerator import worker from openff.bespokefit.schema.tasks import HessianTask, OptimizationTask, Torsion1DTask from openff.bespokefit.utilities.molecule import canonic...
en
0.945006
# Ensure the SMILES has a canonical ordering to help ensure cache hits. Checks to see if a QC task has already been executed and if not send it to a worker. # Canonicalize the task to improve the cache hit rate. # Make sure to only set the hash after the type is set in case the connection # goes down before this in...
2.098108
2
advanced-workflows/task-graphs-lab/exercise/plugins/lab/plugin/workflows.py
jrzeszutek/cloudify-training-labs
6
601
'''Copyright Gigaspaces, 2017, All Rights Reserved''' from cloudify.plugins import lifecycle OP_START = 'hacker.interfaces.lifecycle.start' OP_STOP = 'hacker.interfaces.lifecycle.stop' OP_SS_C = 'hacker.interfaces.lifecycle.create_snapshots' OP_SS_D = 'hacker.interfaces.lifecycle.delete_snapshots' REQUIRED_OPS = set([...
'''Copyright Gigaspaces, 2017, All Rights Reserved''' from cloudify.plugins import lifecycle OP_START = 'hacker.interfaces.lifecycle.start' OP_STOP = 'hacker.interfaces.lifecycle.stop' OP_SS_C = 'hacker.interfaces.lifecycle.create_snapshots' OP_SS_D = 'hacker.interfaces.lifecycle.delete_snapshots' REQUIRED_OPS = set([...
en
0.820969
Copyright Gigaspaces, 2017, All Rights Reserved Builds sequenced subgraph tasks for an instance .. note:: The sequence will not be built if the instance provided does not have a node with an operation defined in the operation parameter. :param `CloudifyWorkflowNodeInstance` instance: ...
2.390016
2
File Transfer/Flyter/flyter.py
CryptoNyxz/Miscellaneous-Tools
0
602
<gh_stars>0 """ Flyter Tool for transferring files on the same network using raw sockets. Doesn't use encryption. """ __version__ = (0, 0, 0) __author__ = "CryptoNyxz" __license__ = """ MIT License Copyright (c) 2021 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this softwa...
""" Flyter Tool for transferring files on the same network using raw sockets. Doesn't use encryption. """ __version__ = (0, 0, 0) __author__ = "CryptoNyxz" __license__ = """ MIT License Copyright (c) 2021 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and assoc...
en
0.792057
Flyter Tool for transferring files on the same network using raw sockets. Doesn't use encryption. MIT License Copyright (c) 2021 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without re...
1.959146
2
tests/test_modeling_tf_led.py
patelrajnath/transformers
0
603
# coding=utf-8 # Copyright <NAME>, <NAME>, <NAME> and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
# coding=utf-8 # Copyright <NAME>, <NAME>, <NAME> and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
en
0.821307
# coding=utf-8 # Copyright <NAME>, <NAME>, <NAME> and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
1.795203
2
src/wann_genetic/individual/numpy/ffnn.py
plonerma/wann-genetic
0
604
<filename>src/wann_genetic/individual/numpy/ffnn.py import numpy as np import sklearn import logging from wann_genetic.individual.network_base import BaseFFNN def softmax(x, axis=-1): """Compute softmax values for each sets of scores in x. Returns: softmax - softmax normalized in dim axis """ ...
<filename>src/wann_genetic/individual/numpy/ffnn.py import numpy as np import sklearn import logging from wann_genetic.individual.network_base import BaseFFNN def softmax(x, axis=-1): """Compute softmax values for each sets of scores in x. Returns: softmax - softmax normalized in dim axis """ ...
en
0.739237
Compute softmax values for each sets of scores in x. Returns: softmax - softmax normalized in dim axis Apply the activation function of the selected nodes to their sums. This fullfils the same function as the :class:`wann_genetic.individual.torch.ffn.MultiActivationModule`. # return function names N...
2.981031
3
common/tests/util.py
uktrade/tamato
14
605
import contextlib from datetime import date from datetime import datetime from datetime import timezone from functools import wraps from io import BytesIO from itertools import count from typing import Any from typing import Dict from typing import Sequence import pytest from dateutil.parser import parse as parse_date...
import contextlib from datetime import date from datetime import datetime from datetime import timezone from functools import wraps from io import BytesIO from itertools import count from typing import Any from typing import Dict from typing import Sequence import pytest from dateutil.parser import parse as parse_date...
en
0.801294
Creates two records using the passed factory that are duplicates of each other and returns the record created last. # allow overriding identifying_fields Creates two records using the passed factory that are not duplicates of each other and returns the record created last. Returns a dict representing the model'...
1.832593
2
src/com/python/email/send_mail.py
Leeo1124/pythonDemo
0
606
<gh_stars>0 ''' Created on 2016年8月10日 @author: Administrator ''' from email import encoders from email.header import Header from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.multipart import MIMEBase from email.utils import parseaddr, formataddr import smtplib def _fo...
''' Created on 2016年8月10日 @author: Administrator ''' from email import encoders from email.header import Header from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.multipart import MIMEBase from email.utils import parseaddr, formataddr import smtplib def _format_addr(s)...
zh
0.611837
Created on 2016年8月10日 @author: Administrator # 发送纯文本邮件 # msg = MIMEText('hello, send by Python...', 'plain', 'utf-8') # 发送HTML邮件 # msg = MIMEText('<html><body><h1>Hello</h1>' + # '<p>send by <a href="http://www.python.org">Python</a>...</p>' + # '</body></html>', 'html', 'utf-8') # 发送带附件的邮件 # 邮件对象: # 邮件正文是MIME...
3.05878
3
studies/mixture_feasibility/parsley_benchmark/alcohol_ester/run.py
openforcefield/nistdataselection
3
607
<filename>studies/mixture_feasibility/parsley_benchmark/alcohol_ester/run.py<gh_stars>1-10 from evaluator import unit from evaluator.backends import QueueWorkerResources from evaluator.backends.dask import DaskLSFBackend from evaluator.client import ConnectionOptions, EvaluatorClient from evaluator.datasets import Phys...
<filename>studies/mixture_feasibility/parsley_benchmark/alcohol_ester/run.py<gh_stars>1-10 from evaluator import unit from evaluator.backends import QueueWorkerResources from evaluator.backends.dask import DaskLSFBackend from evaluator.client import ConnectionOptions, EvaluatorClient from evaluator.datasets import Phys...
en
0.817711
# Load in the force field # Load in the test set. # Set up a server object to run the calculations using. # Set up a backend to run the calculations on. This assume running # on a HPC resources with the LSF queue system installed. # Request the estimates. # Wait for the results.
2.094242
2
nuplan/planning/simulation/observation/idm/test/test_profile_idm_observation.py
motional/nuplan-devkit
128
608
import logging import unittest from pyinstrument import Profiler from nuplan.planning.scenario_builder.nuplan_db.test.nuplan_scenario_test_utils import get_test_nuplan_scenario from nuplan.planning.simulation.history.simulation_history_buffer import SimulationHistoryBuffer from nuplan.planning.simulation.observation....
import logging import unittest from pyinstrument import Profiler from nuplan.planning.scenario_builder.nuplan_db.test.nuplan_scenario_test_utils import get_test_nuplan_scenario from nuplan.planning.simulation.history.simulation_history_buffer import SimulationHistoryBuffer from nuplan.planning.simulation.observation....
en
0.812625
Profiling test for IDM agents. Inherited, see super class. Profile IDMAgents. # How many times to repeat runtime test
2.352455
2
baselines/ddpg/ddpg.py
RDaneelOlivav/baselines
11
609
<filename>baselines/ddpg/ddpg.py import os import os.path as osp import time from collections import deque import pickle from baselines.ddpg.ddpg_learner import DDPG from baselines.ddpg.models import Actor, Critic from baselines.ddpg.memory import Memory from baselines.ddpg.noise import AdaptiveParamNoiseSpec, NormalA...
<filename>baselines/ddpg/ddpg.py import os import os.path as osp import time from collections import deque import pickle from baselines.ddpg.ddpg_learner import DDPG from baselines.ddpg.models import Actor, Critic from baselines.ddpg.memory import Memory from baselines.ddpg.noise import AdaptiveParamNoiseSpec, NormalA...
en
0.891972
# with default settings, perform 1M steps total # per epoch cycle and MPI worker, # per MPI worker # we assume symmetric actions. # Prepare everything. #vector # vector #scalar # scalar # Perform rollouts. # if simulating multiple envs in parallel, impossible to reset agent at the end of the episode in each # of the en...
1.829489
2
footprints/transaction_details.py
enwawerueli/footprints
1
610
<filename>footprints/transaction_details.py import os from datetime import datetime from PySide2.QtGui import * from PySide2.QtCore import * from PySide2.QtWidgets import * from PySide2.QtPrintSupport import QPrinter, QPrintDialog from jinja2 import TemplateNotFound from .ui.ui_transaction_details import Ui_Transacti...
<filename>footprints/transaction_details.py import os from datetime import datetime from PySide2.QtGui import * from PySide2.QtCore import * from PySide2.QtWidgets import * from PySide2.QtPrintSupport import QPrinter, QPrintDialog from jinja2 import TemplateNotFound from .ui.ui_transaction_details import Ui_Transacti...
none
1
1.964325
2
yt/units/yt_array.py
FeiLi5/git-github.com-yt-project-yt
0
611
""" YTArray class. """ from __future__ import print_function #----------------------------------------------------------------------------- # Copyright (c) 2013, yt Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this so...
""" YTArray class. """ from __future__ import print_function #----------------------------------------------------------------------------- # Copyright (c) 2013, yt Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this so...
en
0.695476
YTArray class. #----------------------------------------------------------------------------- # Copyright (c) 2013, yt Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------...
1.773464
2
src/posts/api/serializers.py
MahmoudMagdi20/django_rest_blog_api
0
612
<gh_stars>0 from rest_framework import serializers from posts.models import Post class PostCreateUpdateSerializer(serializers.ModelSerializer): class Meta: model = Post fields = [ #'id', 'title', #'slug', 'content', 'publish', ] ...
from rest_framework import serializers from posts.models import Post class PostCreateUpdateSerializer(serializers.ModelSerializer): class Meta: model = Post fields = [ #'id', 'title', #'slug', 'content', 'publish', ] post_detail_...
it
0.463807
#'id', #'slug',
2.238478
2
Protheus_WebApp/Modules/SIGAGTP/GTPA036ETestCase.py
98llm/tir-script-samples
17
613
<reponame>98llm/tir-script-samples from tir import Webapp import unittest class GTPA036E(unittest.TestCase): @classmethod def setUpClass(inst): inst.oHelper = Webapp() inst.oHelper.Setup("SIGAGTP", "05/08/2020", "T1", "D MG 01 ") inst.oHelper.Program('GTPA036') def test_GTPA036E_CT001(self): ...
from tir import Webapp import unittest class GTPA036E(unittest.TestCase): @classmethod def setUpClass(inst): inst.oHelper = Webapp() inst.oHelper.Setup("SIGAGTP", "05/08/2020", "T1", "D MG 01 ") inst.oHelper.Program('GTPA036') def test_GTPA036E_CT001(self): self.oHelper.SetButton('Avançar') ...
en
0.482473
self.oHelper.ClickGridCell("", row=2, grid_number=1)
2.607031
3
code_tmpl/views.py
lovebirdegg/nnms-server
0
614
<filename>code_tmpl/views.py<gh_stars>0 # @Time : {time} # @Author : code_generator from rest_framework.viewsets import ModelViewSet from rest_framework.generics import ListAPIView from rest_framework.filters import SearchFilter, OrderingFilter from rest_framework.response import Response from rest_framework.decor...
<filename>code_tmpl/views.py<gh_stars>0 # @Time : {time} # @Author : code_generator from rest_framework.viewsets import ModelViewSet from rest_framework.generics import ListAPIView from rest_framework.filters import SearchFilter, OrderingFilter from rest_framework.response import Response from rest_framework.decor...
fr
0.250751
# @Time : {time} # @Author : code_generator
1.812592
2
src/collectors/heartbeat/heartbeat.py
art19/netuitive-diamond
2
615
<reponame>art19/netuitive-diamond<filename>src/collectors/heartbeat/heartbeat.py # coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbe...
# coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbeat Netuitive Change History ======================== DVG 2016/11/14 In...
en
0.760611
# coding=utf-8 Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbeat Netuitive Change History ======================== DVG 2016/11/14 Initial...
2.101159
2
process_script/stat.py
vitorebatista/AVEMH
2
616
<reponame>vitorebatista/AVEMH import numpy as np import pandas as pd import sys markets = ["hangseng", "dax", "ftse", "sp", "nikkei"] market = markets[int(sys.argv[1])-1] # read GD data file dat = pd.read_csv("./num_res/{}.GD.csv".format(market)) # split into two experiments exp1_GD = dat[dat.columns[:5]]...
import numpy as np import pandas as pd import sys markets = ["hangseng", "dax", "ftse", "sp", "nikkei"] market = markets[int(sys.argv[1])-1] # read GD data file dat = pd.read_csv("./num_res/{}.GD.csv".format(market)) # split into two experiments exp1_GD = dat[dat.columns[:5]] exp2_GD = dat[dat.columns[5:...
en
0.617272
# read GD data file # split into two experiments # calculate statistics # find best and second best algorithm # print("{}.GD:".format(market), best2_GD[0], best2_GD[1]) # TODO: check error # read Spacing data file # split into two experiments # calculate statistics # find best and second best algorithm # print("{}.Spac...
3.203329
3
Scripts/calc_Utilities.py
zmlabe/ThicknessSensitivity
1
617
<gh_stars>1-10 """ Functions are useful untilities for SITperturb experiments Notes ----- Author : <NAME> Date : 13 August 2017 Usage ----- [1] calcDecJan(varx,vary,lat,lon,level,levsq) [2] calcDecJanFeb(varx,vary,lat,lon,level,levsq) [3] calc_indttest(varx,vary) [4] calc_weightedAve(va...
""" Functions are useful untilities for SITperturb experiments Notes ----- Author : <NAME> Date : 13 August 2017 Usage ----- [1] calcDecJan(varx,vary,lat,lon,level,levsq) [2] calcDecJanFeb(varx,vary,lat,lon,level,levsq) [3] calc_indttest(varx,vary) [4] calc_weightedAve(var,lats) [5]...
en
0.224294
Functions are useful untilities for SITperturb experiments Notes ----- Author : <NAME> Date : 13 August 2017 Usage ----- [1] calcDecJan(varx,vary,lat,lon,level,levsq) [2] calcDecJanFeb(varx,vary,lat,lon,level,levsq) [3] calc_indttest(varx,vary) [4] calc_weightedAve(var,lats) [5] cal...
3.155408
3
tests/python/unittest/test_tir_schedule_compute_inline.py
xiebaiyuan/tvm
0
618
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
en
0.834231
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
1.82175
2
cwl_flask.py
Sage-Bionetworks/workflow-service
1
619
from flask import Flask, Response, request, redirect import subprocess import tempfile import json import yaml import signal import threading import time import copy app = Flask(__name__) jobs_lock = threading.Lock() jobs = [] class Job(threading.Thread): def __init__(self, jobid, path, inputobj): super...
from flask import Flask, Response, request, redirect import subprocess import tempfile import json import yaml import signal import threading import time import copy app = Flask(__name__) jobs_lock = threading.Lock() jobs = [] class Job(threading.Thread): def __init__(self, jobid, path, inputobj): super...
en
0.418136
# app.debug = True
2.087993
2
cs15211/ReverseBits.py
JulyKikuAkita/PythonPrac
1
620
<reponame>JulyKikuAkita/PythonPrac __source__ = 'https://leetcode.com/problems/reverse-bits/description/' # https://github.com/kamyu104/LeetCode/blob/master/Python/reverse-bits.py # Time : O(n) # Space: O(1) # Bit Manipulation # # Description: Leetcode # 190. Reverse Bits # # Reverse bits of a given 32 bits unsigned in...
__source__ = 'https://leetcode.com/problems/reverse-bits/description/' # https://github.com/kamyu104/LeetCode/blob/master/Python/reverse-bits.py # Time : O(n) # Space: O(1) # Bit Manipulation # # Description: Leetcode # 190. Reverse Bits # # Reverse bits of a given 32 bits unsigned integer. # # For example, given input...
en
0.478955
# https://github.com/kamyu104/LeetCode/blob/master/Python/reverse-bits.py # Time : O(n) # Space: O(1) # Bit Manipulation # # Description: Leetcode # 190. Reverse Bits # # Reverse bits of a given 32 bits unsigned integer. # # For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), ...
3.725356
4
tibanna/_version.py
freezecoder/tibanna
0
621
<gh_stars>0 """Version information.""" # The following line *must* be the last in the module, exactly as formatted: __version__ = "0.16.1"
"""Version information.""" # The following line *must* be the last in the module, exactly as formatted: __version__ = "0.16.1"
en
0.861531
Version information. # The following line *must* be the last in the module, exactly as formatted:
1.120316
1
selective_merge_pdf.py
vs-slavchev/selective_merge_pdf
0
622
from sys import argv from PyPDF2 import PdfFileReader, PdfFileWriter import re range_pattern = re.compile(r'(\d+)(\.\.|-)(\d+)') comma_pattern = re.compile('\d+(,\d+)*') def pages_args_to_array(pages_str): groups = range_pattern.search(pages_str) if groups: start = int(groups.group(1)) end = int(groups.group(3)...
from sys import argv from PyPDF2 import PdfFileReader, PdfFileWriter import re range_pattern = re.compile(r'(\d+)(\.\.|-)(\d+)') comma_pattern = re.compile('\d+(,\d+)*') def pages_args_to_array(pages_str): groups = range_pattern.search(pages_str) if groups: start = int(groups.group(1)) end = int(groups.group(3)...
none
1
3.25886
3
vp/scoring.py
romack77/vp-toolbox
10
623
import math from vp import geom_tools def horizon_error(ground_truth_horizon, detected_horizon, image_dims): """Calculates error in a detected horizon. This measures the max distance between the detected horizon line and the ground truth horizon line, within the image's x-axis, and normalized by ima...
import math from vp import geom_tools def horizon_error(ground_truth_horizon, detected_horizon, image_dims): """Calculates error in a detected horizon. This measures the max distance between the detected horizon line and the ground truth horizon line, within the image's x-axis, and normalized by ima...
en
0.87305
Calculates error in a detected horizon. This measures the max distance between the detected horizon line and the ground truth horizon line, within the image's x-axis, and normalized by image height. Args: ground_truth_horizon: Tuple with (slope, intercept) for the GT horizon line. dete...
3.063778
3
compositional-rl-benchmark/composition/spinningup_training/train_mtl_ppo.py
collassubmission91/CompoSuite-Code
0
624
import numpy as np import argparse import composition import os import json import torch from spinup.algos.pytorch.ppo.core import MLPActorCritic from spinup.algos.pytorch.ppo.ppo import ppo from spinup.utils.run_utils import setup_logger_kwargs from spinup.utils.mpi_tools import proc_id, num_procs def parse_args()...
import numpy as np import argparse import composition import os import json import torch from spinup.algos.pytorch.ppo.core import MLPActorCritic from spinup.algos.pytorch.ppo.ppo import ppo from spinup.utils.run_utils import setup_logger_kwargs from spinup.utils.mpi_tools import proc_id, num_procs def parse_args()...
en
0.167474
# args.exp_name = "t:" + str(args.task_id) + "_name:" + args.exp_name + "_robot:" + str(args.robot) + "_task:" + str(args.task) + "_object:" + str(args.object) + "_obstacle:" + str(args.obstacle)
1.884084
2
pypy/interpreter/test/test_generator.py
m4sterchain/mesapy
381
625
<filename>pypy/interpreter/test/test_generator.py class AppTestGenerator: def test_generator(self): def f(): yield 1 assert f().next() == 1 def test_generator2(self): def f(): yield 1 g = f() assert g.next() == 1 raises(StopIteration, g.n...
<filename>pypy/interpreter/test/test_generator.py class AppTestGenerator: def test_generator(self): def f(): yield 1 assert f().next() == 1 def test_generator2(self): def f(): yield 1 g = f() assert g.next() == 1 raises(StopIteration, g.n...
en
0.79193
if 1: def f(): v = (yield ) yield v g = f() g.next() # two arguments version # single argument version if 1: def f(): try: yield 1 v = (yield 2) except: yield 3 g = f() # String except...
2.480357
2
igvm/cli.py
innogames/igvm
14
626
"""igvm - The command line interface Copyright (c) 2017 InnoGames GmbH """ from __future__ import print_function from argparse import ArgumentParser, _SubParsersAction from logging import StreamHandler, root as root_logger import time from fabric.network import disconnect_all from igvm.commands import ( change_...
"""igvm - The command line interface Copyright (c) 2017 InnoGames GmbH """ from __future__ import print_function from argparse import ArgumentParser, _SubParsersAction from logging import StreamHandler, root as root_logger import time from fabric.network import disconnect_all from igvm.commands import ( change_...
en
0.876876
igvm - The command line interface Copyright (c) 2017 InnoGames GmbH # There will probably only be one subparser_action, but better safe # than sorry. # Get all subparsers and print help Extend StreamHandler to format messages short-cutting Formatters # Fabric requires the disconnect function to be called after every #...
2.409978
2
test/test_data_processor/test_condition_generation_dataset.py
puraminy/OpenPrompt
979
627
<reponame>puraminy/OpenPrompt import os, sys from os.path import dirname as d from os.path import abspath, join root_dir = d(d(d(abspath(__file__)))) sys.path.append(root_dir) from openprompt.data_utils.conditional_generation_dataset import PROCESSORS base_path = os.path.join(root_dir, "datasets/CondGen") def test_We...
import os, sys from os.path import dirname as d from os.path import abspath, join root_dir = d(d(d(abspath(__file__)))) sys.path.append(root_dir) from openprompt.data_utils.conditional_generation_dataset import PROCESSORS base_path = os.path.join(root_dir, "datasets/CondGen") def test_WebNLGProcessor(): dataset_n...
none
1
2.305458
2
BaseTools/Source/Python/Common/BuildToolError.py
JayLeeCompal/EDKII_Git
1
628
## @file # Standardized Error Hanlding infrastructures. # # Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text...
## @file # Standardized Error Hanlding infrastructures. # # Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text...
en
0.731907
## @file # Standardized Error Hanlding infrastructures. # # Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of th...
1.198117
1
datasets/SUN397EncodbleDataset.py
allenai/ViRB
26
629
import torch import torchvision.transforms as transforms from torch.utils.data import Dataset import glob from PIL import Image import random class SUN397EncodableDataset(Dataset): """SUN397 encodable dataset class""" def __init__(self, train=True): super().__init__() path = 'data/SUN397/trai...
import torch import torchvision.transforms as transforms from torch.utils.data import Dataset import glob from PIL import Image import random class SUN397EncodableDataset(Dataset): """SUN397 encodable dataset class""" def __init__(self, train=True): super().__init__() path = 'data/SUN397/trai...
en
0.335955
SUN397 encodable dataset class
2.532932
3
cybox/common/location.py
tirkarthi/python-cybox
40
630
<reponame>tirkarthi/python-cybox<filename>cybox/common/location.py # Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. from mixbox import entities, fields import cybox import cybox.bindings.cybox_common as common_binding class LocationFactory(entities.EntityFactor...
# Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. from mixbox import entities, fields import cybox import cybox.bindings.cybox_common as common_binding class LocationFactory(entities.EntityFactory): @classmethod def entity_class(cls, key): return...
en
0.871963
# Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. # overridden by subclasses
2.278958
2
scripts/bam-stats.py
varlociraptor/prosic-evaluation
2
631
<gh_stars>1-10 #!/usr/bin/env python import sys import numpy as np import pandas as pd import pysam import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt import seaborn as sns from functools import partial tumor = pysam.AlignmentFile(snakemake.input[0], "rb") normal = pysam.AlignmentFile(snakemake.i...
#!/usr/bin/env python import sys import numpy as np import pandas as pd import pysam import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt import seaborn as sns from functools import partial tumor = pysam.AlignmentFile(snakemake.input[0], "rb") normal = pysam.AlignmentFile(snakemake.input[1], "rb") ...
ru
0.26433
#!/usr/bin/env python
1.982844
2
app/rss_feeder_api/migrations/0003_auto_20200813_1623.py
RSaab/rss-scraper
0
632
<reponame>RSaab/rss-scraper<gh_stars>0 # Generated by Django 3.1 on 2020-08-13 16:23 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('rss_feeder_api', '0002_feed_subtitle'), ] operations = [ migrations.AlterM...
# Generated by Django 3.1 on 2020-08-13 16:23 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('rss_feeder_api', '0002_feed_subtitle'), ] operations = [ migrations.AlterModelOptions( name='entry', ...
en
0.783605
# Generated by Django 3.1 on 2020-08-13 16:23
1.790674
2
AdversarialSampleGeneratorV11/AdversarialSampleGeneratorV11/ResNetConstructor.py
MetaMain/BewareAdvML
1
633
import tensorflow from tensorflow import keras Model = keras.models.Model Dense = keras.layers.Dense Activation = keras.layers.Activation Flatten = keras.layers.Flatten BatchNormalization= keras.layers.BatchNormalization Conv2D = tensorflow.keras.layers.Conv2D AveragePooling2D = keras.layers.AveragePooling2D I...
import tensorflow from tensorflow import keras Model = keras.models.Model Dense = keras.layers.Dense Activation = keras.layers.Activation Flatten = keras.layers.Flatten BatchNormalization= keras.layers.BatchNormalization Conv2D = tensorflow.keras.layers.Conv2D AveragePooling2D = keras.layers.AveragePooling2D I...
en
0.70138
2D Convolution-Batch Normalization-Activation stack builder # Arguments inputs (tensor): input tensor from input image or previous layer num_filters (int): Conv2D number of filters kernel_size (int): Conv2D square kernel dimensions strides (int): Conv2D square stride dimensions ...
3.098358
3
ttl2json.py
the-norman-sicily-project/genealogical-trees
1
634
#!/usr/bin/env python3 import sys import json import rdflib import rdflib.plugins.sparql as sparql RELS_TO_DRAW = ['isWifeOf', 'isMotherOf', 'isFatherOf', 'isHusbandOf', 'isSpouseOf'] RELS_TO_INFER = ['hasGrandParent', 'isGrandParentOf', 'hasGreatGrandParent', 'isGreatGrandParentOf', 'isUncleOf', 'ha...
#!/usr/bin/env python3 import sys import json import rdflib import rdflib.plugins.sparql as sparql RELS_TO_DRAW = ['isWifeOf', 'isMotherOf', 'isFatherOf', 'isHusbandOf', 'isSpouseOf'] RELS_TO_INFER = ['hasGrandParent', 'isGrandParentOf', 'hasGreatGrandParent', 'isGreatGrandParentOf', 'isUncleOf', 'ha...
ru
0.112824
#!/usr/bin/env python3 #" PREFIX fhkb:<http://www.example.com/genealogy.owl#> SELECT ?person ?pred ?obj WHERE { ?person a fhkb:Person ; ?pred ?obj . } ORDER BY ?person PREFIX fhkb:<http://www.example.com/genealogy.owl#> SELECT ?person ?pred ?obj WHERE { ?person a fhkb:Perso...
2.335846
2
tests/rest/client/test_login.py
BearerPipelineTest/synapse-1
0
635
# Copyright 2019-2021 The Matrix.org Foundation C.I.C. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# Copyright 2019-2021 The Matrix.org Foundation C.I.C. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
en
0.833902
# Copyright 2019-2021 The Matrix.org Foundation C.I.C. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
1.656335
2
rmf_demo_tasks/rmf_demo_tasks/request_delivery.py
Kevinskwk/rmf_demos
0
636
<gh_stars>0 import argparse import sys from time import sleep import uuid import rclpy from rmf_task_msgs.msg import Delivery def main(argv = sys.argv): rclpy.init(args=argv) args_without_ros = rclpy.utilities.remove_ros_args(argv) ''' # Example request: task_id: randomid_001 items: [itemA,...
import argparse import sys from time import sleep import uuid import rclpy from rmf_task_msgs.msg import Delivery def main(argv = sys.argv): rclpy.init(args=argv) args_without_ros = rclpy.utilities.remove_ros_args(argv) ''' # Example request: task_id: randomid_001 items: [itemA, itemB....] ...
en
0.387129
# Example request: task_id: randomid_001 items: [itemA, itemB....] pickup_place_name: cssd_room pickup_behavior: - name: dispenser - parameters: [request_guid: xxx, target_guid:cssdbot, transporter_type:mir] dropoff_place_name: ot_prep_room dropoff_behavior: - name: dispenser - p...
2.395863
2
dis_snek/api/http/http_client.py
BoredManCodes/Dis-Snek
0
637
<filename>dis_snek/api/http/http_client.py """This file handles the interaction with discords http endpoints.""" import asyncio import logging from typing import Any, Dict, Optional, Union from urllib.parse import quote as _uriquote from weakref import WeakValueDictionary import aiohttp from aiohttp import BaseConnect...
<filename>dis_snek/api/http/http_client.py """This file handles the interaction with discords http endpoints.""" import asyncio import logging from typing import Any, Dict, Optional, Union from urllib.parse import quote as _uriquote from weakref import WeakValueDictionary import aiohttp from aiohttp import BaseConnect...
en
0.866382
This file handles the interaction with discords http endpoints. Manages the global ratelimit # global rate-limit is 50 per second, conservatively we use 45 Lock the global lock for a given duration. Args: delta: The time to keep the lock acquired Manages the ratelimit for each bucket Return True if...
2.124131
2
config.py
conradsuuna/uac-computer-competency
0
638
from os import environ import psycopg2 from datetime import timedelta from dotenv import load_dotenv load_dotenv() class Config(object): """ app configuration class """ TESTING = False CSRF_ENABLED = True SECRET_KEY = environ.get('SECRET_KEY') USER = environ.get('DB_USER') PASSWORD = environ.g...
from os import environ import psycopg2 from datetime import timedelta from dotenv import load_dotenv load_dotenv() class Config(object): """ app configuration class """ TESTING = False CSRF_ENABLED = True SECRET_KEY = environ.get('SECRET_KEY') USER = environ.get('DB_USER') PASSWORD = environ.g...
en
0.626592
app configuration class # jwt configuarations for the user auth api # pagination app development configuration class
2.229058
2
electrum/version.py
c4pt000/electrum-radiocoin
0
639
<filename>electrum/version.py ELECTRUM_VERSION = '4.1.5-radc' # version of the client package APK_VERSION = '4.1.5.0' # read by buildozer.spec PROTOCOL_VERSION = '1.4' # protocol version requested # The hash of the mnemonic seed must begin with this SEED_PREFIX = '01' # Standard wallet SEED...
<filename>electrum/version.py ELECTRUM_VERSION = '4.1.5-radc' # version of the client package APK_VERSION = '4.1.5.0' # read by buildozer.spec PROTOCOL_VERSION = '1.4' # protocol version requested # The hash of the mnemonic seed must begin with this SEED_PREFIX = '01' # Standard wallet SEED...
en
0.831217
# version of the client package # read by buildozer.spec # protocol version requested # The hash of the mnemonic seed must begin with this # Standard wallet # Segwit wallet # Two-factor authentication # Two-factor auth, using segwit
1.874356
2
lib/layers/functions/prior_box.py
arleyzhang/object-detection-pytorch
4
640
from __future__ import division from math import sqrt as sqrt from itertools import product as product import torch import numpy as np import cv2 from lib.utils.visualize_utils import TBWriter def vis(func): """tensorboard visualization if has writer as input""" def wrapper(*args, **kw): return func...
from __future__ import division from math import sqrt as sqrt from itertools import product as product import torch import numpy as np import cv2 from lib.utils.visualize_utils import TBWriter def vis(func): """tensorboard visualization if has writer as input""" def wrapper(*args, **kw): return func...
en
0.541816
tensorboard visualization if has writer as input Compute priorbox coordinates in center-offset form for each source feature map. allow prior num calculation before knowing feature map size # TODO test with image # TODO add output path to the signature # transform coordinates # [x, y] # bboxs: [xmin, ymin, xmax, yma...
2.141236
2
python/Gaffer/SequencePath.py
cwmartin/gaffer
0
641
########################################################################## # # Copyright (c) 2012-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
########################################################################## # # Copyright (c) 2012-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
en
0.631856
########################################################################## # # Copyright (c) 2012-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
1.215576
1
reo/migrations/0121_merge_20211001_1841.py
NREL/REopt_API
7
642
# Generated by Django 3.1.13 on 2021-10-01 18:41 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('reo', '0117_financialmodel_generator_fuel_escalation_pct'), ('reo', '0120_auto_20210927_2046'), ('reo', '0121_auto_20211012_0305') ] operat...
# Generated by Django 3.1.13 on 2021-10-01 18:41 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('reo', '0117_financialmodel_generator_fuel_escalation_pct'), ('reo', '0120_auto_20210927_2046'), ('reo', '0121_auto_20211012_0305') ] operat...
en
0.841837
# Generated by Django 3.1.13 on 2021-10-01 18:41
1.361027
1
PhysicsTools/Heppy/python/analyzers/objects/TauAnalyzer.py
ckamtsikis/cmssw
852
643
from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer from PhysicsTools.Heppy.analyzers.core.AutoHandle import AutoHandle from PhysicsTools.Heppy.physicsobjects.Tau import Tau from PhysicsTools.HeppyCore.utils.deltar import deltaR, matchObjectCollection3 import PhysicsTools.HeppyCore.framework.config as cfg...
from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer from PhysicsTools.Heppy.analyzers.core.AutoHandle import AutoHandle from PhysicsTools.Heppy.physicsobjects.Tau import Tau from PhysicsTools.HeppyCore.utils.deltar import deltaR, matchObjectCollection3 import PhysicsTools.HeppyCore.framework.config as cfg...
en
0.593999
#---------------------------------------- # DECLARATION OF HANDLES OF LEPTONS STUFF #---------------------------------------- #------------------ # MAKE LEPTON LISTS #------------------ #get all #make inclusive taus Create an integer equal to 1-2-3 for (loose,medium,tight) Create an integer equal to 1-2-3-4-5 for (very...
2.110509
2
vize/170401038.py
omuryorulmaz/kriptografi
8
644
# <NAME> 170401038 import math import random r = 3271 def egcd(a,b): if(a == 0): return(b,0,1) else: c,d,e = egcd(b % a, a) return(c, e - (b // a) * d, d) def modInvert(a,b): c,d,e = egcd(a,b) if c != 1: raise Exception('moduler ters bulunamadi') ...
# <NAME> 170401038 import math import random r = 3271 def egcd(a,b): if(a == 0): return(b,0,1) else: c,d,e = egcd(b % a, a) return(c, e - (b // a) * d, d) def modInvert(a,b): c,d,e = egcd(a,b) if c != 1: raise Exception('moduler ters bulunamadi') ...
en
0.235886
# <NAME> 170401038
3.125785
3
seqenv/ontology.py
xapple/seqenv
7
645
# Built-in modules # # Internal modules # from seqenv import module_dir from seqenv.common.cache import property_cached # Third party modules # import sh, networkx import matplotlib.colors # A list of envos to help test this module # test_envos = [ "ENVO:00000033", "ENVO:00000043", "ENVO:00000067", "...
# Built-in modules # # Internal modules # from seqenv import module_dir from seqenv.common.cache import property_cached # Third party modules # import sh, networkx import matplotlib.colors # A list of envos to help test this module # test_envos = [ "ENVO:00000033", "ENVO:00000043", "ENVO:00000067", "...
en
0.578715
# Built-in modules # # Internal modules # # Third party modules # # A list of envos to help test this module # ################################################################################ A object that gives you access to the graph (network with nodes and edges) of the ENVO ontology from the OBO file's path. ...
2.338365
2
sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_models.py
adewaleo/azure-sdk-for-python
1
646
<reponame>adewaleo/azure-sdk-for-python # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R)...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
en
0.695983
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
1.902002
2
tests/unit/controllers/v1/test_rbac_for_supported_st2api_endpoints.py
cognifloyd/st2-open-rbac
0
647
<reponame>cognifloyd/st2-open-rbac<gh_stars>0 # Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Ver...
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
en
0.840929
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
1.573659
2
testing/scripts/test_ksonnet_single_namespace.py
dtrawins/seldon-core
0
648
import pytest import time import subprocess from subprocess import run,Popen from seldon_utils import * from k8s_utils import * def wait_for_shutdown(deploymentName): ret = run("kubectl get deploy/"+deploymentName, shell=True) while ret.returncode == 0: time.sleep(1) ret = run("kubectl get depl...
import pytest import time import subprocess from subprocess import run,Popen from seldon_utils import * from k8s_utils import * def wait_for_shutdown(deploymentName): ret = run("kubectl get deploy/"+deploymentName, shell=True) while ret.returncode == 0: time.sleep(1) ret = run("kubectl get depl...
en
0.742609
# Test singe model helm script with 4 API methods # Test AB Test model helm script with 4 API methods # Test MAB Test model helm script with 4 API methods
2.008779
2
enthought/envisage/safeweakref.py
enthought/etsproxy
3
649
<reponame>enthought/etsproxy # proxy module from __future__ import absolute_import from envisage.safeweakref import *
# proxy module from __future__ import absolute_import from envisage.safeweakref import *
es
0.125187
# proxy module
1.082722
1
test_app/models.py
alissonmuller/django-group-by
25
650
from django.db import models from .query import BookQuerySet class Book(models.Model): objects = BookQuerySet.as_manager() title = models.CharField(max_length=50) publication_date = models.DateTimeField() author = models.ForeignKey('Author') genres = models.ManyToManyField('Genre') class Autho...
from django.db import models from .query import BookQuerySet class Book(models.Model): objects = BookQuerySet.as_manager() title = models.CharField(max_length=50) publication_date = models.DateTimeField() author = models.ForeignKey('Author') genres = models.ManyToManyField('Genre') class Autho...
none
1
2.410215
2
ResNet/dropblock.py
whj363636/CamDrop
0
651
<reponame>whj363636/CamDrop # -*- coding: utf-8 -*- # File: dropblock.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import re import six # from tensorpack.tfutils.compat import tfv1 as tf # this should be avoided first in model code from tensorpack.tfu...
# -*- coding: utf-8 -*- # File: dropblock.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import re import six # from tensorpack.tfutils.compat import tfv1 as tf # this should be avoided first in model code from tensorpack.tfutils.tower import get_curren...
en
0.479543
# -*- coding: utf-8 -*- # File: dropblock.py # from tensorpack.tfutils.compat import tfv1 as tf # this should be avoided first in model code # 1: paper baseline; 2: group dropout; 3: group soft-dropout; 4: Uout group dropout DropBlock: a regularization method for convolutional neural networks. DropBlock is a form of...
2.922466
3
tutorial/deprecated/tutorial_recurrent_policy/main_a2c.py
Purple-PI/rlstructures
281
652
<gh_stars>100-1000 # # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # from rlstructures import logging from rlstructures.env_wrappers import GymEnv, GymEnvInf from rlstructures.tools impor...
# # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # from rlstructures import logging from rlstructures.env_wrappers import GymEnv, GymEnvInf from rlstructures.tools import weight_init impor...
en
0.889574
# # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # # We write the 'create_env' and 'create_agent' function in the main file to allow these functions to be used with pickle when creating the ...
2.340159
2
dashboard/gnd-app.py
buchmuseum/GND_Dashboard
5
653
from matplotlib.pyplot import title import streamlit as st import pandas as pd import altair as alt import pydeck as pdk import os import glob from wordcloud import WordCloud import streamlit_analytics path = os.path.dirname(__file__) streamlit_analytics.start_tracking() @st.cache def load_gnd_top_daten(typ): gn...
from matplotlib.pyplot import title import streamlit as st import pandas as pd import altair as alt import pydeck as pdk import os import glob from wordcloud import WordCloud import streamlit_analytics path = os.path.dirname(__file__) streamlit_analytics.start_tracking() @st.cache def load_gnd_top_daten(typ): gn...
de
0.980882
#wordcloud der top 100 sachbegriffe eines auszuwählenden tages der letzten 10 werktage #ranking und karte der meistverwendeten wirkungsorte aller personen in der gnd #Balkendiagramm #Karte #nach jahrzehnten zwischen 1400 und 2010 gefilterte auswertung der GND-Musikwerke, Musik-Personen und Wikrungsorte und daraus abgel...
2.93648
3
seamo/support/seamo_exceptions.py
amandalynne/Seattle-Mobility-Index
3
654
<filename>seamo/support/seamo_exceptions.py """ Class for all excpetions used in following scripts - geocoder.py - geocoder_input.py """ class OverlappingGeographyError(Exception): def __init__(self, message): self.message = message # msg: geodataframe has overlapping polygons representing geographic ...
<filename>seamo/support/seamo_exceptions.py """ Class for all excpetions used in following scripts - geocoder.py - geocoder_input.py """ class OverlappingGeographyError(Exception): def __init__(self, message): self.message = message # msg: geodataframe has overlapping polygons representing geographic ...
en
0.905318
Class for all excpetions used in following scripts - geocoder.py - geocoder_input.py # msg: geodataframe has overlapping polygons representing geographic features # please how shapefiles are processed. # msg: geodataframe has overlapping polygons representing geographic features # please how shapefiles are processed.
2.538499
3
vize/150401052/sunucu.py
hasan-se/blm304
1
655
#<NAME> 150401052 import os import sys import time from socket import * from os import system, name ip = '127.0.0.1' port = 42 s_soket = socket(AF_INET, SOCK_DGRAM) s_soket.bind((ip, port)) print("\nSunucu Hazir\n") kontrol, istemciAdres = s_soket.recv...
#<NAME> 150401052 import os import sys import time from socket import * from os import system, name ip = '127.0.0.1' port = 42 s_soket = socket(AF_INET, SOCK_DGRAM) s_soket.bind((ip, port)) print("\nSunucu Hazir\n") kontrol, istemciAdres = s_soket.recv...
de
0.365313
#<NAME> 150401052
2.472808
2
httprunner/compat.py
panyuan209/httprunner
0
656
<filename>httprunner/compat.py<gh_stars>0 """ This module handles compatibility issues between testcase format v2 and v3. 解决httprunner2 和 3 之间测试用例兼容性问题 """ import os import sys from typing import List, Dict, Text, Union, Any from loguru import logger from httprunner import exceptions from httprunner.loader import loa...
<filename>httprunner/compat.py<gh_stars>0 """ This module handles compatibility issues between testcase format v2 and v3. 解决httprunner2 和 3 之间测试用例兼容性问题 """ import os import sys from typing import List, Dict, Text, Union, Any from loguru import logger from httprunner import exceptions from httprunner.loader import loa...
en
0.317848
This module handles compatibility issues between testcase format v2 and v3. 解决httprunner2 和 3 之间测试用例兼容性问题 # [{"var1": 1}, {"var2": 2}] # get variables by function, e.g. ${get_variables()} # content.xx/json.xx => body.xx # add quotes for field with separator # e.g. headers.Content-Type => headers."Content-Type" # conver...
2.296743
2
examples/demo/basic/scatter.py
ContinuumIO/chaco
3
657
""" Scatter plot with panning and zooming Shows a scatter plot of a set of random points, with basic Chaco panning and zooming. Interacting with the plot: - Left-mouse-drag pans the plot. - Mouse wheel up and down zooms the plot in and out. - Pressing "z" brings up the Zoom Box, and you can click-drag a recta...
""" Scatter plot with panning and zooming Shows a scatter plot of a set of random points, with basic Chaco panning and zooming. Interacting with the plot: - Left-mouse-drag pans the plot. - Mouse wheel up and down zooms the plot in and out. - Pressing "z" brings up the Zoom Box, and you can click-drag a recta...
en
0.68297
Scatter plot with panning and zooming Shows a scatter plot of a set of random points, with basic Chaco panning and zooming. Interacting with the plot: - Left-mouse-drag pans the plot. - Mouse wheel up and down zooms the plot in and out. - Pressing "z" brings up the Zoom Box, and you can click-drag a rectangul...
4.206877
4
webstr/core/config.py
fbalak/webstr
3
658
""" Central configuration module of webstr selenium tests. This module provides configuration options along with default values and function to redefine values. """ # Copyright 2016 Red Hat # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Li...
""" Central configuration module of webstr selenium tests. This module provides configuration options along with default values and function to redefine values. """ # Copyright 2016 Red Hat # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Li...
en
0.760758
Central configuration module of webstr selenium tests. This module provides configuration options along with default values and function to redefine values. # Copyright 2016 Red Hat # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # ...
2.504798
3
operations/mutations/mutation.py
PiotrBosowski/feat-genes
0
659
<filename>operations/mutations/mutation.py import random class Mutation: def __init__(self, chrom_mut_chance, gen_mut_chance): self.chrom_mut_chance = chrom_mut_chance self.gen_mut_chance = gen_mut_chance def __call__(self, population): chroms_to_mutate = random.sample( po...
<filename>operations/mutations/mutation.py import random class Mutation: def __init__(self, chrom_mut_chance, gen_mut_chance): self.chrom_mut_chance = chrom_mut_chance self.gen_mut_chance = gen_mut_chance def __call__(self, population): chroms_to_mutate = random.sample( po...
none
1
3.120772
3
examples/CountLettersInList.py
Ellis0817/Introduction-to-Programming-Using-Python
0
660
<filename>examples/CountLettersInList.py import RandomCharacter # Defined in Listing 6.9 def main(): """Main.""" # Create a list of characters chars = createList() # Display the list print("The lowercase letters are:") displayList(chars) # Count the occurrences of each letter counts...
<filename>examples/CountLettersInList.py import RandomCharacter # Defined in Listing 6.9 def main(): """Main.""" # Create a list of characters chars = createList() # Display the list print("The lowercase letters are:") displayList(chars) # Count the occurrences of each letter counts...
en
0.777494
# Defined in Listing 6.9 Main. # Create a list of characters # Display the list # Count the occurrences of each letter # Display counts Create a list of characters. # Create an empty list # Create lowercase letters randomly and add them to the list # Return the list Display the list of characters. # Display the charact...
4.286845
4
ddtrace/contrib/vertica/__init__.py
lightstep/dd-trace-py
5
661
""" The Vertica integration will trace queries made using the vertica-python library. Vertica will be automatically instrumented with ``patch_all``, or when using the ``ls-trace-run`` command. Vertica is instrumented on import. To instrument Vertica manually use the ``patch`` function. Note the ordering of the follow...
""" The Vertica integration will trace queries made using the vertica-python library. Vertica will be automatically instrumented with ``patch_all``, or when using the ``ls-trace-run`` command. Vertica is instrumented on import. To instrument Vertica manually use the ``patch`` function. Note the ordering of the follow...
en
0.595028
The Vertica integration will trace queries made using the vertica-python library. Vertica will be automatically instrumented with ``patch_all``, or when using the ``ls-trace-run`` command. Vertica is instrumented on import. To instrument Vertica manually use the ``patch`` function. Note the ordering of the following ...
2.246038
2
desktop/core/ext-py/python-openid-2.2.5/openid/test/test_htmldiscover.py
kokosing/hue
5,079
662
<filename>desktop/core/ext-py/python-openid-2.2.5/openid/test/test_htmldiscover.py from openid.consumer.discover import OpenIDServiceEndpoint import datadriven class BadLinksTestCase(datadriven.DataDrivenTestCase): cases = [ '', "http://not.in.a.link.tag/", '<link rel="openid.server" href="...
<filename>desktop/core/ext-py/python-openid-2.2.5/openid/test/test_htmldiscover.py from openid.consumer.discover import OpenIDServiceEndpoint import datadriven class BadLinksTestCase(datadriven.DataDrivenTestCase): cases = [ '', "http://not.in.a.link.tag/", '<link rel="openid.server" href="...
none
1
2.431434
2
project/settings/production.py
chiehtu/kissaten
0
663
<reponame>chiehtu/kissaten<gh_stars>0 from .base import * SECRET_KEY = get_env_var('SECRET_KEY') CSRF_COOKIE_SECURE = True SESSION_COOKIE_SECURE = True TEMPLATE_LOADERS = ( ('django.template.loaders.cached.Loader', ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_dire...
from .base import * SECRET_KEY = get_env_var('SECRET_KEY') CSRF_COOKIE_SECURE = True SESSION_COOKIE_SECURE = True TEMPLATE_LOADERS = ( ('django.template.loaders.cached.Loader', ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', )), ) EMAIL_BACK...
none
1
1.546202
2
modelflow/graph_viz_from_outputs.py
ModelFlow/modelflow
6
664
import pandas as pd import argparse import json try: from graphviz import Digraph except: print("Note: Optional graphviz not installed") def generate_graph(df, graph_format='pdf'): g = Digraph('ModelFlow', filename='modelflow.gv', engine='neato', format=graph_format) g.attr(overlap='false') g.attr...
import pandas as pd import argparse import json try: from graphviz import Digraph except: print("Note: Optional graphviz not installed") def generate_graph(df, graph_format='pdf'): g = Digraph('ModelFlow', filename='modelflow.gv', engine='neato', format=graph_format) g.attr(overlap='false') g.attr...
en
0.244667
# TODO: THIS DOES NOT WORK FOR MULTIPLE MODELFLOWS # Elipses # Boxes # print(name1, state, df[column_name].min(), # df[column_name].max()) # generate_graph(df)
2.789418
3
src/command/voice_log/chart.py
link1345/Vol-GameClanTools-DiscordBot
0
665
import discord import os import json import datetime import pandas as pd from dateutil.relativedelta import relativedelta from pprint import pprint import base.ColorPrint as CPrint import command.voice_log.Config_Main as CSetting def most_old_Month() : old_month = 1 labels = [] fileNameList = [] while True : ...
import discord import os import json import datetime import pandas as pd from dateutil.relativedelta import relativedelta from pprint import pprint import base.ColorPrint as CPrint import command.voice_log.Config_Main as CSetting def most_old_Month() : old_month = 1 labels = [] fileNameList = [] while True : ...
ja
0.987151
# 調査用に+1してあるので、実際の値は、これにold_monthに-1したものとなる。 #print( "test1" ) #all_df = pd.merge(all_df, df , left_index=True) #df.loc[:,[labelname]] #pprint(all_df) [VC] 指定ロールに参加しているメンバーを抽出する Args: client (discord.Client): クライアント RoleList (list[int]): 役職ID return: list[discord.Member]: 指定ロールに参加しているメンバー # ギルドデータ更新 # ロール制限がな...
2.652009
3
5kyu/(5 kyu) Count IP Addresses/(5 kyu) Count IP Addresses.py
e1r0nd/codewars
49
666
def ips_between(start, end): calc = lambda n, m: (int(end.split(".")[n]) - int(start.split(".")[n])) * m return calc(0, 256 * 256 * 256) + calc(1, 256 * 256) + calc(2, 256) + calc(3, 1)
def ips_between(start, end): calc = lambda n, m: (int(end.split(".")[n]) - int(start.split(".")[n])) * m return calc(0, 256 * 256 * 256) + calc(1, 256 * 256) + calc(2, 256) + calc(3, 1)
none
1
2.957941
3
python/src/vmaf/core/feature_extractor.py
jayholman/vmaf
40
667
from abc import ABCMeta, abstractmethod import os from vmaf.tools.misc import make_absolute_path, run_process from vmaf.tools.stats import ListStats __copyright__ = "Copyright 2016-2018, Netflix, Inc." __license__ = "Apache, Version 2.0" import re import numpy as np import ast from vmaf import ExternalProgramCaller,...
from abc import ABCMeta, abstractmethod import os from vmaf.tools.misc import make_absolute_path, run_process from vmaf.tools.stats import ListStats __copyright__ = "Copyright 2016-2018, Netflix, Inc." __license__ = "Apache, Version 2.0" import re import numpy as np import ast from vmaf import ExternalProgramCaller,...
en
0.687904
FeatureExtractor takes in a list of assets, and run feature extraction on them, and return a list of corresponding results. A FeatureExtractor must specify a unique type and version combination (by the TYPE and VERSION attribute), so that the Result generated by it can be identified. A derived class of...
2.178416
2
notebooks/_solutions/pandas_02_basic_operations28.py
rprops/Python_DS-WS
65
668
<gh_stars>10-100 df['Age'].hist() #bins=30, log=True
df['Age'].hist() #bins=30, log=True
en
0.218845
#bins=30, log=True
2.062892
2
controller/base_service.py
oopsteams/pansite
0
669
# -*- coding: utf-8 -*- """ Created by susy at 2019/11/8 """ from dao.dao import DataDao import pytz from dao.models import PanAccounts from cfg import PAN_SERVICE, MASTER_ACCOUNT_ID class BaseService: def __init__(self): self.default_tz = pytz.timezone('Asia/Chongqing') # self.pan_acc: PanAccoun...
# -*- coding: utf-8 -*- """ Created by susy at 2019/11/8 """ from dao.dao import DataDao import pytz from dao.models import PanAccounts from cfg import PAN_SERVICE, MASTER_ACCOUNT_ID class BaseService: def __init__(self): self.default_tz = pytz.timezone('Asia/Chongqing') # self.pan_acc: PanAccoun...
en
0.714344
# -*- coding: utf-8 -*- Created by susy at 2019/11/8 # self.pan_acc: PanAccounts = DataDao.pan_account_list(MASTER_ACCOUNT_ID, False)
2.114922
2
transformerquant/modules/attention/multi_head.py
StateOfTheArt-quant/transformerquant
22
670
<reponame>StateOfTheArt-quant/transformerquant #!/usr/bin/env python3 # -*- coding: utf-8 -*- import torch.nn as nn from .single import attention class MultiHeadedAttention(nn.Module): def __init__(self, d_model, nhead, dropout=0.1): super().__init__() assert d_model % nhead ==0 ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import torch.nn as nn from .single import attention class MultiHeadedAttention(nn.Module): def __init__(self, d_model, nhead, dropout=0.1): super().__init__() assert d_model % nhead ==0 # we assume d_v always equal d_k s...
en
0.773081
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # we assume d_v always equal d_k # 1) Do all the linear projections in batch from d_model => h x d_k # 2) Apply attention on all the projected vectors in batch. # 3) "Concat" using a view and apply a final linear. #, attn
2.599878
3
avatar/generalization.py
Julian-Theis/AVATAR
7
671
import os, time, argparse from datetime import datetime from pm4py.objects.log.importer.csv import factory as csv_importer from pm4py.objects.log.exporter.xes import factory as xes_exporter from pm4py.objects.log.importer.xes import factory as xes_importer from pm4py.objects.petri.importer import pnml as pnml_importer...
import os, time, argparse from datetime import datetime from pm4py.objects.log.importer.csv import factory as csv_importer from pm4py.objects.log.exporter.xes import factory as xes_exporter from pm4py.objects.log.importer.xes import factory as xes_importer from pm4py.objects.petri.importer import pnml as pnml_importer...
en
0.686189
READ FILES AND CONVERT TO XES PERFORM MEASUREMENT ON PN AND XES
2.218027
2
Introductions/The Rust Programming Language/embed/bindings/embed.py
uqtimes/Rust-SampleCodes
0
672
# $ python embed.py from ctypes import cdll lib = cdll.LoadLibrary("../target/release/libembed.dylib") #=> for Mac #lib = cdll.LoadLibrary("../target/release/libembed.so") #=> for Linux lib.process() print("done!")
# $ python embed.py from ctypes import cdll lib = cdll.LoadLibrary("../target/release/libembed.dylib") #=> for Mac #lib = cdll.LoadLibrary("../target/release/libembed.so") #=> for Linux lib.process() print("done!")
en
0.281387
# $ python embed.py #=> for Mac #lib = cdll.LoadLibrary("../target/release/libembed.so") #=> for Linux
1.726415
2
huaweicloud-sdk-image/huaweicloudsdkimage/v1/image_client.py
handsome-baby/huaweicloud-sdk-python-v3
1
673
<gh_stars>1-10 # coding: utf-8 from __future__ import absolute_import import datetime import re import importlib import six from huaweicloudsdkcore.client import Client, ClientBuilder from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcore.utils import http_utils from huaweicloudsdkcore.sdk_str...
# coding: utf-8 from __future__ import absolute_import import datetime import re import importlib import six from huaweicloudsdkcore.client import Client, ClientBuilder from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcore.utils import http_utils from huaweicloudsdkcore.sdk_stream_request imp...
zh
0.286565
# coding: utf-8 :param configuration: .Configuration object for this client :param pool_threads: The number of threads to use for async requests to the API. More threads means more concurrent API requests. 名人识别 分析并识别图片中包含的政治人物、明星及网红人物,返回人物信息及人脸坐标。 :param RunCelebrityRecognitionRequest requ...
2.34273
2
frank_wolfe.py
ebezzam/PolyatomicFW_SPL
0
674
<gh_stars>0 import numpy as np from typing import Optional, Any from pandas import DataFrame from copy import deepcopy from abc import abstractmethod from utils import TimedGenericIterativeAlgorithm import pycsou.core as pcore import pycsou.linop as pl from pycsou.func.penalty import L1Norm from pycsou.func.loss impo...
import numpy as np from typing import Optional, Any from pandas import DataFrame from copy import deepcopy from abc import abstractmethod from utils import TimedGenericIterativeAlgorithm import pycsou.core as pcore import pycsou.linop as pl from pycsou.func.penalty import L1Norm from pycsou.func.loss import SquaredL2...
en
0.527427
# print("Threshold: {} / {}".format(threshold, maxi)) # print('Candidate indices: {}\n'.format(indices.shape)) # already present position Dual ceritificate value is computed after iteration Returns ------- # before iteration # restricted_data_fidelity.lipschitz_cst = self.data_fidelity.lipschitz_cst # ...
2.077783
2
lib/rdflib-3.1.0/test/test_trix_serialize.py
suzuken/xbrlparser
3
675
#!/usr/bin/env python import unittest from rdflib.graph import ConjunctiveGraph from rdflib.term import URIRef, Literal from rdflib.graph import Graph class TestTrixSerialize(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def testSerialize(self): s1 = URIRef...
#!/usr/bin/env python import unittest from rdflib.graph import ConjunctiveGraph from rdflib.term import URIRef, Literal from rdflib.graph import Graph class TestTrixSerialize(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def testSerialize(self): s1 = URIRef...
en
0.88715
#!/usr/bin/env python # TODO: Fix once getGraph/getContext is in conjunctive graph # BNode, this is a bit ugly # we cannot match the bnode to the right graph automagically # here I know there is only one anonymous graph, # and that is the default one, but this is not always the case
2.414291
2
dbschema/revertDBinstall.py
leschzinerlab/myami-3.2-freeHand
0
676
#!/usr/bin/env python from sinedon import dbupgrade, dbconfig import updatelib project_dbupgrade = dbupgrade.DBUpgradeTools('projectdata', drop=True) if __name__ == "__main__": updatelib_inst = updatelib.UpdateLib(project_dbupgrade) checkout_version = raw_input('Revert to checkout version, for example, 2.1 -->') i...
#!/usr/bin/env python from sinedon import dbupgrade, dbconfig import updatelib project_dbupgrade = dbupgrade.DBUpgradeTools('projectdata', drop=True) if __name__ == "__main__": updatelib_inst = updatelib.UpdateLib(project_dbupgrade) checkout_version = raw_input('Revert to checkout version, for example, 2.1 -->') i...
ru
0.26433
#!/usr/bin/env python
2.47407
2
fightchurn/listings/chap9/listing_9_4_regression_cparam.py
guy4261/fight-churn
151
677
from sklearn.linear_model import LogisticRegression from fightchurn.listings.chap8.listing_8_2_logistic_regression import prepare_data, save_regression_model from fightchurn.listings.chap8.listing_8_2_logistic_regression import save_regression_summary, save_dataset_predictions def regression_cparam(data_set_path, C_pa...
from sklearn.linear_model import LogisticRegression from fightchurn.listings.chap8.listing_8_2_logistic_regression import prepare_data, save_regression_model from fightchurn.listings.chap8.listing_8_2_logistic_regression import save_regression_summary, save_dataset_predictions def regression_cparam(data_set_path, C_pa...
none
1
2.143035
2
notebooks/classical_clustering.py
prise6/smart-iss-posts
0
678
#%% [markdown] # # Clustering classique #%% [markdown] # ## import classique import os #%% %load_ext autoreload %autoreload 2 os.chdir('/home/jovyan/work') #%% [markdown] # ## Import iss #%% from iss.tools import Config from iss.tools import Tools from iss.models import SimpleConvAutoEncoder from iss.clustering imp...
#%% [markdown] # # Clustering classique #%% [markdown] # ## import classique import os #%% %load_ext autoreload %autoreload 2 os.chdir('/home/jovyan/work') #%% [markdown] # ## Import iss #%% from iss.tools import Config from iss.tools import Tools from iss.models import SimpleConvAutoEncoder from iss.clustering imp...
zh
0.260204
#%% [markdown] # # Clustering classique #%% [markdown] # ## import classique #%% #%% [markdown] # ## Import iss #%% #%% [markdown] # ## Chargement de la config #%% #%% [markdown] # ## Chargement du modèle #%% ## charger le modèle #%% [markdown] ## Chargement des images #%% #%% #%% #%% [markdown] # ## ACP # Réduction de...
2.018637
2
SM_28BYJ48/logger/logger.py
kaulketh/stepper-motor-stuff
0
679
#!/usr/bin/python3 # -*- coding: utf-8 -*- # ----------------------------------------------------------- # created 02.02.2021, tkaulke # <NAME>, <EMAIL> # https://github.com/kaulketh # ----------------------------------------------------------- __author__ = "<NAME>" __email__ = "<EMAIL>" import errno import logging ...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # ----------------------------------------------------------- # created 02.02.2021, tkaulke # <NAME>, <EMAIL> # https://github.com/kaulketh # ----------------------------------------------------------- __author__ = "<NAME>" __email__ = "<EMAIL>" import errno import logging ...
en
0.35187
#!/usr/bin/python3 # -*- coding: utf-8 -*- # ----------------------------------------------------------- # created 02.02.2021, tkaulke # <NAME>, <EMAIL> # https://github.com/kaulketh # ----------------------------------------------------------- # runtime location # define log folder related to location # define ini and...
2.50964
3
tests/test_mr_uplift.py
Ibotta/mr_uplift
48
680
<gh_stars>10-100 import numpy as np import pytest from mr_uplift.dataset.data_simulation import get_no_noise_data, get_simple_uplift_data, get_observational_uplift_data_1 from mr_uplift.mr_uplift import MRUplift, get_t_data from mr_uplift.keras_model_functionality import prepare_data_optimized_loss import sys import p...
import numpy as np import pytest from mr_uplift.dataset.data_simulation import get_no_noise_data, get_simple_uplift_data, get_observational_uplift_data_1 from mr_uplift.mr_uplift import MRUplift, get_t_data from mr_uplift.keras_model_functionality import prepare_data_optimized_loss import sys import pandas as pd clas...
none
1
2.22797
2
lambdataalchemani/lambda_test.py
Full-Data-Alchemist/lambdata-Mani-alch
0
681
""" """ import unittest from example_module import COLORS, increment class ExampleTest(unittest.TestCase): """ #TODO """ def test_increment(self): x0 = 0 y0 = increment(x0) #y0 == 1 self.assertEqual(y0, 1) x1 = 100 y1 = increment(x1) #y1 == 101 se...
""" """ import unittest from example_module import COLORS, increment class ExampleTest(unittest.TestCase): """ #TODO """ def test_increment(self): x0 = 0 y0 = increment(x0) #y0 == 1 self.assertEqual(y0, 1) x1 = 100 y1 = increment(x1) #y1 == 101 se...
en
0.10984
#TODO #y0 == 1 #y1 == 101
3.490497
3
desktop/core/src/desktop/auth/views.py
bopopescu/hue-5
1
682
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
en
0.852755
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
1.70082
2
models/node.py
AlonsoReyes/t-intersection-graph
0
683
class Node(object): def __init__(self, name, follow_list, intention, lane): self.name = name self.follow_list = follow_list self.intention = intention self.lane = lane def __eq__(self, other): if isinstance(other, Node): if self.name == other.get...
class Node(object): def __init__(self, name, follow_list, intention, lane): self.name = name self.follow_list = follow_list self.intention = intention self.lane = lane def __eq__(self, other): if isinstance(other, Node): if self.name == other.get...
none
1
3.515883
4
gsheetsdb/url.py
tim-werner/gsheets-db-api
3
684
<reponame>tim-werner/gsheets-db-api<filename>gsheetsdb/url.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from collections import OrderedDict from moz_sql_parser import parse as parse_sql import pyparsing import r...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from collections import OrderedDict from moz_sql_parser import parse as parse_sql import pyparsing import re from six.moves.urllib import parse FROM_REGEX = re.compile...
en
0.923934
# fallback to regex to extract from
2.135828
2
detr/datasets/construction_panoptic.py
joyjeni/detr-fine
0
685
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import json from pathlib import Path import numpy as np import torch from PIL import Image from panopticapi.utils import rgb2id # from util.box_ops import masks_to_boxes from .construction import make_construction_transforms import logging def...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import json from pathlib import Path import numpy as np import torch from PIL import Image from panopticapi.utils import rgb2id # from util.box_ops import masks_to_boxes from .construction import make_construction_transforms import logging def...
en
0.757888
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # from util.box_ops import masks_to_boxes # sort 'images' field so that they are aligned with 'annotations' # i.e., in alphabetical order # sanity check # labels = torch.tensor( # [ann["category_id"] for ann in ann_info["segments_info"]], # ...
2.265004
2
Code/all-starter-code/search.py
diyarkudrat/CS-1.3-Core-Data-Structures
0
686
#!python """ ANNOTATE FUNCTIONS WITH TIME AND SPACE COMPLEXITY!!!!! """ def linear_search(array, item): """return the first index of item in array or None if item is not found""" return linear_search_iterative(array, item) # return linear_search_recursive(array, item) def linear_search_iterative(ar...
#!python """ ANNOTATE FUNCTIONS WITH TIME AND SPACE COMPLEXITY!!!!! """ def linear_search(array, item): """return the first index of item in array or None if item is not found""" return linear_search_iterative(array, item) # return linear_search_recursive(array, item) def linear_search_iterative(ar...
en
0.758516
#!python ANNOTATE FUNCTIONS WITH TIME AND SPACE COMPLEXITY!!!!! return the first index of item in array or None if item is not found # return linear_search_recursive(array, item) Time complexity: O(n) because you iterate through n amount of items in array Space Complexity: O(n) because there are n amount of ite...
4.43564
4
max_ai/src/max_ai/mem_db.py
mat-heim/max_ros
0
687
#!/usr/bin/python ''' memory class stored in sqlite data base holds raw input and memories in parse taged columns ''' import sys import re import sqlite3 import os from datetime import date, datetime from pattern.en import parse from pattern.en import pprint from pattern.en import parsetree from pattern.en import ...
#!/usr/bin/python ''' memory class stored in sqlite data base holds raw input and memories in parse taged columns ''' import sys import re import sqlite3 import os from datetime import date, datetime from pattern.en import parse from pattern.en import pprint from pattern.en import parsetree from pattern.en import ...
en
0.625569
#!/usr/bin/python memory class stored in sqlite data base holds raw input and memories in parse taged columns #dir = os.path.dirname(os.path.abspath(__file__)) #RM = sqlite3.connect(dir + '/data/robbie_memory.db') # Information about a single concept # what/how is 'concept' # unused # where is 'concept' # e.g. a thing...
3.410358
3
examples/pylab_examples/image_masked.py
pierre-haessig/matplotlib
16
688
<filename>examples/pylab_examples/image_masked.py #!/usr/bin/env python '''imshow with masked array input and out-of-range colors. The second subplot illustrates the use of BoundaryNorm to get a filled contour effect. ''' from pylab import * from numpy import ma import matplotlib.colors as colors delta = 0.0...
<filename>examples/pylab_examples/image_masked.py #!/usr/bin/env python '''imshow with masked array input and out-of-range colors. The second subplot illustrates the use of BoundaryNorm to get a filled contour effect. ''' from pylab import * from numpy import ma import matplotlib.colors as colors delta = 0.0...
en
0.821941
#!/usr/bin/env python imshow with masked array input and out-of-range colors. The second subplot illustrates the use of BoundaryNorm to get a filled contour effect. # difference of Gaussians # Set up a colormap: # Alternatively, we could use # palette.set_bad(alpha = 0.0) # to make the bad region transparent. ...
2.836006
3
app/schemas/socket.py
d3vzer0/reternal-backend
6
689
from pydantic import BaseModel, validator, Field from typing import List, Dict from datetime import datetime class Authenticate(BaseModel): access_token: str
from pydantic import BaseModel, validator, Field from typing import List, Dict from datetime import datetime class Authenticate(BaseModel): access_token: str
none
1
2.281393
2
meme/meme.py
aniket091/modmail-plugins-1
8
690
<reponame>aniket091/modmail-plugins-1 import discord from discord.ext import commands import requests import random from box import Box class WildMemes(commands.Cog): """ Randomly spawns memes. """ subreddits = [ "dankmemes", "wholesomememes", "memes", "terriblefacebookmemes", "hist...
import discord from discord.ext import commands import requests import random from box import Box class WildMemes(commands.Cog): """ Randomly spawns memes. """ subreddits = [ "dankmemes", "wholesomememes", "memes", "terriblefacebookmemes", "historymemes", "me_irl", "2meirl4m...
en
0.659378
Randomly spawns memes.
2.789676
3
pcat2py/class/20bdcef0-5cc5-11e4-af55-00155d01fe08.py
phnomcobra/PCAT2PY
0
691
#!/usr/bin/python ################################################################################ # 20bdcef0-5cc5-11e4-af55-00155d01fe08 # # <NAME> # <EMAIL> # <EMAIL> # # 10/24/2014 Original Construction ################################################################################ class Finding: def __init__(...
#!/usr/bin/python ################################################################################ # 20bdcef0-5cc5-11e4-af55-00155d01fe08 # # <NAME> # <EMAIL> # <EMAIL> # # 10/24/2014 Original Construction ################################################################################ class Finding: def __init__(...
de
0.574357
#!/usr/bin/python ################################################################################ # 20bdcef0-5cc5-11e4-af55-00155d01fe08 # # <NAME> # <EMAIL> # <EMAIL> # # 10/24/2014 Original Construction ################################################################################ # Initialize Compliance # Get Reg...
2.156621
2
mikan/exceptions.py
dzzhvks94vd2/mikan
1
692
<reponame>dzzhvks94vd2/mikan class MikanException(Exception): """Generic Mikan exception""" class ConversionError(MikanException, ValueError): """Cannot convert a string"""
class MikanException(Exception): """Generic Mikan exception""" class ConversionError(MikanException, ValueError): """Cannot convert a string"""
en
0.138963
Generic Mikan exception Cannot convert a string
2.198275
2
cv_recommender/account/urls.py
hhhameem/CV-Recommender
1
693
<reponame>hhhameem/CV-Recommender<gh_stars>1-10 from django.urls import path from django.contrib.auth import views as auth_views from . import views urlpatterns = [ path('register/', views.register, name='register'), path('login/', views.userlogin, name='login'), path('logout/', views.userlogout, name='log...
from django.urls import path from django.contrib.auth import views as auth_views from . import views urlpatterns = [ path('register/', views.register, name='register'), path('login/', views.userlogin, name='login'), path('logout/', views.userlogout, name='logout'), path('password_change/', auth_views.P...
none
1
1.803471
2
Moodle/scripts/edit_conf.py
nii-gakunin-cloud/ocs-templates
4
694
from datetime import datetime from difflib import unified_diff from logging import basicConfig, getLogger, INFO import os from pathlib import Path import shutil import subprocess import sys import yaml from urllib.parse import urlparse from notebook import notebookapp from IPython.core.display import HTML WORKDIR = ...
from datetime import datetime from difflib import unified_diff from logging import basicConfig, getLogger, INFO import os from pathlib import Path import shutil import subprocess import sys import yaml from urllib.parse import urlparse from notebook import notebookapp from IPython.core.display import HTML WORKDIR = ...
none
1
2.001923
2
other/minimum_edit_distance.py
newvicklee/nlp_algorithms
0
695
""" Minimum edit distance computes the cost it takes to get from one string to another string. This implementation uses the Levenshtein distance with a cost of 1 for insertions or deletions and a cost of 2 for substitutions. Resource: https://en.wikipedia.org/wiki/Edit_distance For example, getting from "intention" ...
""" Minimum edit distance computes the cost it takes to get from one string to another string. This implementation uses the Levenshtein distance with a cost of 1 for insertions or deletions and a cost of 2 for substitutions. Resource: https://en.wikipedia.org/wiki/Edit_distance For example, getting from "intention" ...
en
0.867158
Minimum edit distance computes the cost it takes to get from one string to another string. This implementation uses the Levenshtein distance with a cost of 1 for insertions or deletions and a cost of 2 for substitutions. Resource: https://en.wikipedia.org/wiki/Edit_distance For example, getting from "intention" to "...
3.882446
4
varifier/dnadiff.py
iqbal-lab-org/varifier
11
696
from operator import attrgetter import logging import os import shutil import subprocess import pyfastaq import pymummer from cluster_vcf_records import vcf_record from varifier import utils # We only want the .snps file from the dnadiff script from MUMmer. From reading # the docs inspecting that script, we need to ...
from operator import attrgetter import logging import os import shutil import subprocess import pyfastaq import pymummer from cluster_vcf_records import vcf_record from varifier import utils # We only want the .snps file from the dnadiff script from MUMmer. From reading # the docs inspecting that script, we need to ...
en
0.919413
# We only want the .snps file from the dnadiff script from MUMmer. From reading # the docs inspecting that script, we need to run these commands: # # nucmer --maxmatch --delta out.delta ref.fasta query.fasta # delta-filter -1 out.delta > out.1delta # show-snps -rlTHC out.1delta > out.snps # # This is instead of just ru...
2.425909
2
modules/models.py
sbj-ss/github-watcher
0
697
<gh_stars>0 from dataclasses import asdict, dataclass from typing import Any, Dict, List, Type @dataclass(frozen=True) class StatsBaseModel: """Base model for various reports""" @classmethod def key(cls: Type) -> str: name = cls.__name__ return name[0].lower() + name[1:] def to_table(...
from dataclasses import asdict, dataclass from typing import Any, Dict, List, Type @dataclass(frozen=True) class StatsBaseModel: """Base model for various reports""" @classmethod def key(cls: Type) -> str: name = cls.__name__ return name[0].lower() + name[1:] def to_table(self) -> Lis...
en
0.950531
Base model for various reports
2.83256
3
queryfilter/datetimefilter.py
iCHEF/queryfilter
4
698
from __future__ import absolute_import import datetime from dateutil import parser import pytz from .base import FieldFilter, DictFilterMixin, DjangoQueryFilterMixin from .queryfilter import QueryFilter WHOLE_DAY = datetime.timedelta(days=1) ONE_SECOND = datetime.timedelta(seconds=1) @QueryFilter.register_type_c...
from __future__ import absolute_import import datetime from dateutil import parser import pytz from .base import FieldFilter, DictFilterMixin, DjangoQueryFilterMixin from .queryfilter import QueryFilter WHOLE_DAY = datetime.timedelta(days=1) ONE_SECOND = datetime.timedelta(seconds=1) @QueryFilter.register_type_c...
none
1
2.30712
2
built-in/TensorFlow/Research/cv/image_classification/Cars_for_TensorFlow/automl/vega/search_space/networks/pytorch/operator/rpn.py
Huawei-Ascend/modelzoo
12
699
<reponame>Huawei-Ascend/modelzoo<filename>built-in/TensorFlow/Research/cv/image_classification/Cars_for_TensorFlow/automl/vega/search_space/networks/pytorch/operator/rpn.py # -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistri...
# -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the...
en
0.683285
# -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the ...
1.837565
2