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
OLD/karma_module/text.py
alentoghostflame/StupidAlentoBot
1
8800
<gh_stars>1-10 ADDED_KARMA_TO_MEMBER = "Gave {} karma to {}, their karma is now at {}." REMOVED_KARMA_FROM_MEMBER = "Removed {} karma from {}, their karma is now at {}." LIST_KARMA_OWN = "You currently have {} karma." LIST_KARMA_OBJECT = "\"{}\" currently has {} karma." LIST_KARMA_MEMBER = "{} currently has {} karma."...
ADDED_KARMA_TO_MEMBER = "Gave {} karma to {}, their karma is now at {}." REMOVED_KARMA_FROM_MEMBER = "Removed {} karma from {}, their karma is now at {}." LIST_KARMA_OWN = "You currently have {} karma." LIST_KARMA_OBJECT = "\"{}\" currently has {} karma." LIST_KARMA_MEMBER = "{} currently has {} karma." KARMA_TOP_STA...
none
1
1.450052
1
read_delphin_data.py
anssilaukkarinen/mry-cluster2
0
8801
<filename>read_delphin_data.py # -*- coding: utf-8 -*- """ Created on Mon Dec 6 14:51:24 2021 @author: laukkara This script is run first to fetch results data from university's network drive """ import os import pickle input_folder_for_Delphin_data = r'S:\91202_Rakfys_Mallinnus\RAMI\simulations' output_folder = ...
<filename>read_delphin_data.py # -*- coding: utf-8 -*- """ Created on Mon Dec 6 14:51:24 2021 @author: laukkara This script is run first to fetch results data from university's network drive """ import os import pickle input_folder_for_Delphin_data = r'S:\91202_Rakfys_Mallinnus\RAMI\simulations' output_folder = ...
en
0.819867
# -*- coding: utf-8 -*- Created on Mon Dec 6 14:51:24 2021 @author: laukkara This script is run first to fetch results data from university's network drive ## Preparations ## Read in results data from pickle files
2.664645
3
api/config.py
sumesh-aot/namex
1
8802
"""Config for initializing the namex-api.""" import os from dotenv import find_dotenv, load_dotenv # this will load all the envars from a .env file located in the project root (api) load_dotenv(find_dotenv()) CONFIGURATION = { 'development': 'config.DevConfig', 'testing': 'config.TestConfig', 'production...
"""Config for initializing the namex-api.""" import os from dotenv import find_dotenv, load_dotenv # this will load all the envars from a .env file located in the project root (api) load_dotenv(find_dotenv()) CONFIGURATION = { 'development': 'config.DevConfig', 'testing': 'config.TestConfig', 'production...
en
0.5116
Config for initializing the namex-api. # this will load all the envars from a .env file located in the project root (api) Base config (also production config). # POSTGRESQL # ORACLE - LEGACY NRO NAMESDB # JWT_OIDC Settings # You can disable NRO updates for Name Requests by setting the variable in your .env / OpenShift ...
2.431407
2
examples/pylab_examples/fancybox_demo2.py
pierre-haessig/matplotlib
16
8803
<reponame>pierre-haessig/matplotlib<gh_stars>10-100 import matplotlib.patches as mpatch import matplotlib.pyplot as plt styles = mpatch.BoxStyle.get_styles() figheight = (len(styles)+.5) fig1 = plt.figure(1, (4/1.5, figheight/1.5)) fontsize = 0.3 * 72 for i, (stylename, styleclass) in enumerate(styles.items()): ...
import matplotlib.patches as mpatch import matplotlib.pyplot as plt styles = mpatch.BoxStyle.get_styles() figheight = (len(styles)+.5) fig1 = plt.figure(1, (4/1.5, figheight/1.5)) fontsize = 0.3 * 72 for i, (stylename, styleclass) in enumerate(styles.items()): fig1.text(0.5, (float(len(styles)) - 0.5 - i)/fighei...
none
1
2.422122
2
setup.py
sdu-cfei/modest-py
37
8804
from setuptools import setup setup( name='modestpy', version='0.1', description='FMI-compliant model identification package', url='https://github.com/sdu-cfei/modest-py', keywords='fmi fmu optimization model identification estimation', author='<NAME>, Center for Energy Informatics SDU', aut...
from setuptools import setup setup( name='modestpy', version='0.1', description='FMI-compliant model identification package', url='https://github.com/sdu-cfei/modest-py', keywords='fmi fmu optimization model identification estimation', author='<NAME>, Center for Energy Informatics SDU', aut...
none
1
1.129361
1
gfworkflow/core.py
andersonbrands/gfworkflow
0
8805
<reponame>andersonbrands/gfworkflow import re import subprocess as sp from typing import Union, List from gfworkflow.exceptions import RunCommandException def run(command: Union[str, List[str]]): completed_process = sp.run(command, stdout=sp.PIPE, stderr=sp.PIPE, universal_newlines=True) if completed_process...
import re import subprocess as sp from typing import Union, List from gfworkflow.exceptions import RunCommandException def run(command: Union[str, List[str]]): completed_process = sp.run(command, stdout=sp.PIPE, stderr=sp.PIPE, universal_newlines=True) if completed_process.returncode: raise RunComman...
none
1
2.150712
2
tests/integration/lambdas/lambda_python3.py
jorges119/localstack
31,928
8806
<reponame>jorges119/localstack # simple test function that uses python 3 features (e.g., f-strings) # see https://github.com/localstack/localstack/issues/264 def handler(event, context): # the following line is Python 3.6+ specific msg = f"Successfully processed {event}" # noqa This code is Python 3.6+ only ...
# simple test function that uses python 3 features (e.g., f-strings) # see https://github.com/localstack/localstack/issues/264 def handler(event, context): # the following line is Python 3.6+ specific msg = f"Successfully processed {event}" # noqa This code is Python 3.6+ only return event
en
0.85615
# simple test function that uses python 3 features (e.g., f-strings) # see https://github.com/localstack/localstack/issues/264 # the following line is Python 3.6+ specific # noqa This code is Python 3.6+ only
1.778962
2
import_off.py
etiennody/purchoice
0
8807
<reponame>etiennody/purchoice<gh_stars>0 #! usr/bin/python3 # code: utf-8 """Download data from Open Food Facts API.""" import json import requests from src.purchoice.constants import CATEGORY_SELECTED from src.purchoice.purchoice_database import PurchoiceDatabase class ImportOff: """ImportOff class downloads...
#! usr/bin/python3 # code: utf-8 """Download data from Open Food Facts API.""" import json import requests from src.purchoice.constants import CATEGORY_SELECTED from src.purchoice.purchoice_database import PurchoiceDatabase class ImportOff: """ImportOff class downloads data from Open Food Facts API.""" de...
en
0.69564
#! usr/bin/python3 # code: utf-8 Download data from Open Food Facts API. ImportOff class downloads data from Open Food Facts API. get_urls_params helps to define more precisely the request to Open Food Facts API. Arguments: category {string} -- a name of category. Returns: ...
3.322186
3
orio/module/loop/cfg.py
zhjp0/Orio
0
8808
''' Created on April 26, 2015 @author: norris ''' import ast, sys, os, traceback from orio.main.util.globals import * from orio.tool.graphlib import graph from orio.module.loop import astvisitors class CFGVertex(graph.Vertex): '''A CFG vertex is a basic block.''' def __init__(self, name, node=None): t...
''' Created on April 26, 2015 @author: norris ''' import ast, sys, os, traceback from orio.main.util.globals import * from orio.tool.graphlib import graph from orio.module.loop import astvisitors class CFGVertex(graph.Vertex): '''A CFG vertex is a basic block.''' def __init__(self, name, node=None): t...
en
0.647864
Created on April 26, 2015 @author: norris A CFG vertex is a basic block. # basic block, starting with leader node # End of CFG vertex class # End of CFGEdge class #sys.stdout.write(str(self)) # print buf # End of CFG Graph class Invoke accept method for specified AST node # Children: header: node.init, node.test, node...
2.823057
3
cogs rework/server specified/on_message_delete.py
lubnc4261/House-Keeper
0
8809
import discord from discord import Embed @commands.Cog.listener() async def on_message_delete(self, message): channel = "xxxxxxxxxxxxxxxxxxxxx" deleted = Embed( description=f"Message deleted in {message.channel.mention}", color=0x4040EC ).set_author(name=message.author, url=Embed.Empty,...
import discord from discord import Embed @commands.Cog.listener() async def on_message_delete(self, message): channel = "xxxxxxxxxxxxxxxxxxxxx" deleted = Embed( description=f"Message deleted in {message.channel.mention}", color=0x4040EC ).set_author(name=message.author, url=Embed.Empty,...
none
1
2.599362
3
test/modules/md/md_env.py
icing/mod_md
320
8810
import copy import inspect import json import logging import pytest import re import os import shutil import subprocess import time from datetime import datetime, timedelta from configparser import ConfigParser, ExtendedInterpolation from typing import Dict, List, Optional from pyhttpd.certs import CertificateSpec f...
import copy import inspect import json import logging import pytest import re import os import shutil import subprocess import time from datetime import datetime, timedelta from configparser import ConfigParser, ExtendedInterpolation from typing import Dict, List, Optional from pyhttpd.certs import CertificateSpec f...
en
0.623003
#"AH10045", # mod_md complains that there is no vhost for an MDomain # mod_md does not find a vhost with SSL enabled for an MDomain # mod_ssl complains about fallback certificates # --------- cmd execution --------- # --------- access local store --------- # check private key, validate certificate, etc # check SANs an...
2.13999
2
models/create_message_response.py
ajrice6713/bw-messaging-emulator
0
8811
<reponame>ajrice6713/bw-messaging-emulator import datetime import json import random import string from typing import Dict from sms_counter import SMSCounter class CreateMessageResponse: def __init__(self, request): self.id = self.generate_id() self.owner = request['from'] self.applicati...
import datetime import json import random import string from typing import Dict from sms_counter import SMSCounter class CreateMessageResponse: def __init__(self, request): self.id = self.generate_id() self.owner = request['from'] self.applicationId = request['applicationId'] sel...
none
1
2.645919
3
python/ccxt/async_support/uex.py
victor95pc/ccxt
1
8812
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange # ----------------------------------------------------------------------------- try...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange # ----------------------------------------------------------------------------- try...
en
0.539473
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code # ----------------------------------------------------------------------------- # Python 3 # Python 2 # new metainfo interface # funding limi...
1.55805
2
Alpha & Beta/wootMath/decimalToBinaryFraction.py
Mdlkxzmcp/various_python
0
8813
def decimal_to_binary_fraction(x=0.5): """ Input: x, a float between 0 and 1 Returns binary representation of x """ p = 0 while ((2 ** p) * x) % 1 != 0: # print('Remainder = ' + str((2**p)*x - int((2**p)*x))) p += 1 num = int(x * (2 ** p)) result = '' if num == 0: ...
def decimal_to_binary_fraction(x=0.5): """ Input: x, a float between 0 and 1 Returns binary representation of x """ p = 0 while ((2 ** p) * x) % 1 != 0: # print('Remainder = ' + str((2**p)*x - int((2**p)*x))) p += 1 num = int(x * (2 ** p)) result = '' if num == 0: ...
en
0.804337
Input: x, a float between 0 and 1 Returns binary representation of x # print('Remainder = ' + str((2**p)*x - int((2**p)*x))) # If there is no integer p such that x*(2**p) is a whole number, then internal # representation is always an approximation # Suggest that testing equality of floats is not exact: Use abs(x-y)...
4.049032
4
composer/utils/run_directory.py
ajaysaini725/composer
0
8814
<reponame>ajaysaini725/composer # Copyright 2021 MosaicML. All Rights Reserved. import datetime import logging import os import pathlib import time from composer.utils import dist log = logging.getLogger(__name__) _RUN_DIRECTORY_KEY = "COMPOSER_RUN_DIRECTORY" _start_time_str = datetime.datetime.now().isoformat() ...
# Copyright 2021 MosaicML. All Rights Reserved. import datetime import logging import os import pathlib import time from composer.utils import dist log = logging.getLogger(__name__) _RUN_DIRECTORY_KEY = "COMPOSER_RUN_DIRECTORY" _start_time_str = datetime.datetime.now().isoformat() def get_node_run_directory() ->...
en
0.770862
# Copyright 2021 MosaicML. All Rights Reserved. Returns the run directory for the node. This folder is shared by all ranks on the node. Returns: str: The node run directory. # chop off the training slash so os.path.basename would work as expected Returns the run directory for the current rank. ...
2.359989
2
newsapp/migrations/0003_news.py
adi112100/newsapp
0
8815
# Generated by Django 3.0.8 on 2020-07-11 08:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('newsapp', '0002_auto_20200711_1124'), ] operations = [ migrations.CreateModel( name='News', fields=[ ...
# Generated by Django 3.0.8 on 2020-07-11 08:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('newsapp', '0002_auto_20200711_1124'), ] operations = [ migrations.CreateModel( name='News', fields=[ ...
en
0.795622
# Generated by Django 3.0.8 on 2020-07-11 08:10
1.753405
2
src/enum/__init__.py
NazarioJL/faker_enum
5
8816
# -*- coding: utf-8 -*- from enum import Enum from typing import TypeVar, Type, List, Iterable, cast from faker.providers import BaseProvider TEnum = TypeVar("TEnum", bound=Enum) class EnumProvider(BaseProvider): """ A Provider for enums. """ def enum(self, enum_cls: Type[TEnum]) -> TEnum: ...
# -*- coding: utf-8 -*- from enum import Enum from typing import TypeVar, Type, List, Iterable, cast from faker.providers import BaseProvider TEnum = TypeVar("TEnum", bound=Enum) class EnumProvider(BaseProvider): """ A Provider for enums. """ def enum(self, enum_cls: Type[TEnum]) -> TEnum: ...
en
0.784669
# -*- coding: utf-8 -*- A Provider for enums.
2.961921
3
tests/performance/bottle/simple_server.py
Varriount/sanic
4,959
8817
# Run with: gunicorn --workers=1 --worker-class=meinheld.gmeinheld.MeinheldWorker -b :8000 simple_server:app import bottle import ujson from bottle import route, run @route("/") def index(): return ujson.dumps({"test": True}) app = bottle.default_app()
# Run with: gunicorn --workers=1 --worker-class=meinheld.gmeinheld.MeinheldWorker -b :8000 simple_server:app import bottle import ujson from bottle import route, run @route("/") def index(): return ujson.dumps({"test": True}) app = bottle.default_app()
en
0.512396
# Run with: gunicorn --workers=1 --worker-class=meinheld.gmeinheld.MeinheldWorker -b :8000 simple_server:app
1.734676
2
usuarios/views.py
alvarocneto/alura_django
1
8818
<filename>usuarios/views.py from django.shortcuts import redirect from django.shortcuts import render from django.contrib.auth.models import User from django.views.generic.base import View from perfis.models import Perfil from usuarios.forms import RegistrarUsuarioForm class RegistrarUsuarioView(View): template_...
<filename>usuarios/views.py from django.shortcuts import redirect from django.shortcuts import render from django.contrib.auth.models import User from django.views.generic.base import View from perfis.models import Perfil from usuarios.forms import RegistrarUsuarioForm class RegistrarUsuarioView(View): template_...
pt
0.68944
# preenche o from # verifica se eh valido # cria o usuario # cria o perfil # grava no banco # redireciona para index # so chega aqui se nao for valido # vamos devolver o form para mostrar o formulario preenchido
2.095048
2
antolib/AntoCommon.py
srsuper/BOT2020
1
8819
ANTO_VER = '0.1.2'
ANTO_VER = '0.1.2'
none
1
1.189043
1
cpc_fusion/pkgs/keys/main.py
CPChain/fusion
5
8820
from typing import (Any, Union, Type) # noqa: F401 from ..keys.datatypes import ( LazyBackend, PublicKey, PrivateKey, Signature, ) from eth_keys.exceptions import ( ValidationError, ) from eth_keys.validation import ( validate_message_hash, ) # These must be aliased due to a scoping issue in...
from typing import (Any, Union, Type) # noqa: F401 from ..keys.datatypes import ( LazyBackend, PublicKey, PrivateKey, Signature, ) from eth_keys.exceptions import ( ValidationError, ) from eth_keys.validation import ( validate_message_hash, ) # These must be aliased due to a scoping issue in...
en
0.75043
# noqa: F401 # These must be aliased due to a scoping issue in mypy # https://github.com/python/mypy/issues/1775 # # datatype shortcuts # # type: Type[_PublicKey] # type: Type[_PrivateKey] # type: Type[_Signature] # # Proxy method calls to the backends # # type: bytes # type: _PrivateKey # type: (...) -> _Signature # t...
2.41417
2
qiskit/pulse/transforms/canonicalization.py
gadial/qiskit-terra
1
8821
<reponame>gadial/qiskit-terra # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any ...
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
en
0.803862
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
2.085211
2
tests/test_scraper.py
ananelson/oacensus
0
8822
from oacensus.scraper import Scraper from oacensus.commands import defaults class TestScraper(Scraper): """ Scraper for testing scraper methods. """ aliases = ['testscraper'] def scrape(self): pass def process(self): pass def test_hashcode(): scraper = Scraper.create_inst...
from oacensus.scraper import Scraper from oacensus.commands import defaults class TestScraper(Scraper): """ Scraper for testing scraper methods. """ aliases = ['testscraper'] def scrape(self): pass def process(self): pass def test_hashcode(): scraper = Scraper.create_inst...
en
0.939762
Scraper for testing scraper methods.
2.593766
3
python/test-deco-1-1.py
li-ma/homework
0
8823
def deco1(func): print("before myfunc() called.") func() print("after myfunc() called.") def myfunc(): print("myfunc() called.") deco1(myfunc)
def deco1(func): print("before myfunc() called.") func() print("after myfunc() called.") def myfunc(): print("myfunc() called.") deco1(myfunc)
none
1
2.595969
3
lib/jnpr/junos/transport/tty_netconf.py
mmoucka/py-junos-eznc
0
8824
<reponame>mmoucka/py-junos-eznc import re import time from lxml import etree import select import socket import logging import sys from lxml.builder import E from lxml.etree import XMLSyntaxError from datetime import datetime, timedelta from ncclient.operations.rpc import RPCReply, RPCError from ncclient.xml_ import t...
import re import time from lxml import etree import select import socket import logging import sys from lxml.builder import E from lxml.etree import XMLSyntaxError from datetime import datetime, timedelta from ncclient.operations.rpc import RPCReply, RPCError from ncclient.xml_ import to_ele import six from ncclient.t...
en
0.524567
# ========================================================================= # xmlmode_netconf # ========================================================================= Basic Junos XML API for bootstraping through the TTY # ------------------------------------------------------------------------- # NETCONF session ope...
2.224512
2
test/_test_client.py
eydam-prototyping/mp_modbus
2
8825
from pymodbus.client.sync import ModbusTcpClient as ModbusClient import logging FORMAT = ('%(asctime)-15s %(threadName)-15s ' '%(levelname)-8s %(module)-15s:%(lineno)-8s %(message)s') logging.basicConfig(format=FORMAT) log = logging.getLogger() log.setLevel(logging.DEBUG) client = ModbusClient('192.168.178.61...
from pymodbus.client.sync import ModbusTcpClient as ModbusClient import logging FORMAT = ('%(asctime)-15s %(threadName)-15s ' '%(levelname)-8s %(module)-15s:%(lineno)-8s %(message)s') logging.basicConfig(format=FORMAT) log = logging.getLogger() log.setLevel(logging.DEBUG) client = ModbusClient('192.168.178.61...
none
1
2.134649
2
tests/selenium/test_about/test_about_page.py
technolotrix/tests
0
8826
import unittest from selenium import webdriver import page class AboutPage(unittest.TestCase): def setUp(self): self.driver = webdriver.Firefox() self.driver.get("http://nicolesmith.nyc") #self.driver.get("http://127.0.0.1:4747/about") self.about_page = page.AboutPage(self.driver) ...
import unittest from selenium import webdriver import page class AboutPage(unittest.TestCase): def setUp(self): self.driver = webdriver.Firefox() self.driver.get("http://nicolesmith.nyc") #self.driver.get("http://127.0.0.1:4747/about") self.about_page = page.AboutPage(self.driver) ...
de
0.331163
#self.driver.get("http://127.0.0.1:4747/about") ######## HEADER STUFF ######## ######## PAGE SPECIFIC STUFF ######## ######## FOOTER STUFF ########
3.13721
3
sdk/python/lib/test/langhost/future_input/__main__.py
pcen/pulumi
12,004
8827
# Copyright 2016-2018, Pulumi Corporation. # # 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 or agreed t...
# Copyright 2016-2018, Pulumi Corporation. # # 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 or agreed t...
en
0.860297
# Copyright 2016-2018, Pulumi Corporation. # # 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 or agreed t...
2.686109
3
src/dewloosh/geom/cells/h8.py
dewloosh/dewloosh-geom
2
8828
<filename>src/dewloosh/geom/cells/h8.py # -*- coding: utf-8 -*- from dewloosh.geom.polyhedron import HexaHedron from dewloosh.math.numint import GaussPoints as Gauss from dewloosh.geom.utils import cells_coords from numba import njit, prange import numpy as np from numpy import ndarray __cache = True @njit(nogil=True...
<filename>src/dewloosh/geom/cells/h8.py # -*- coding: utf-8 -*- from dewloosh.geom.polyhedron import HexaHedron from dewloosh.math.numint import GaussPoints as Gauss from dewloosh.geom.utils import cells_coords from numba import njit, prange import numpy as np from numpy import ndarray __cache = True @njit(nogil=True...
en
0.221092
# -*- coding: utf-8 -*- 8-node isoparametric hexahedron. top 7--6 | | 4--5 bottom 3--2 | | 0--1
2.189699
2
shopping_cart_test/shoppingcart2.py
Simbadeveloper/studious-octo-waddle.io
0
8829
<reponame>Simbadeveloper/studious-octo-waddle.io class ShoppingCart(object): def __init__(self): self.total = 0 self.items = dict() def add_item(self, item_name, quantity, price): if item_name != None and quantity >= 1: self.items.update({item_name: quantity}) if quantity and price >= 1: ...
class ShoppingCart(object): def __init__(self): self.total = 0 self.items = dict() def add_item(self, item_name, quantity, price): if item_name != None and quantity >= 1: self.items.update({item_name: quantity}) if quantity and price >= 1: self.total += (quantity * price) def re...
none
1
3.699316
4
tests/models/pr_test_data.py
heaven00/github-contribution-leaderboard
0
8830
import copy import json from ghcl.models.pull_request import PullRequest class PRData: def __init__(self, data: dict = None): if data is None: with open('./tests/models/empty_pr_data.json') as file: self._data = json.load(file) else: self._data = data ...
import copy import json from ghcl.models.pull_request import PullRequest class PRData: def __init__(self, data: dict = None): if data is None: with open('./tests/models/empty_pr_data.json') as file: self._data = json.load(file) else: self._data = data ...
none
1
2.664785
3
Validation/EventGenerator/python/BasicGenParticleValidation_cfi.py
PKUfudawei/cmssw
2
8831
<gh_stars>1-10 import FWCore.ParameterSet.Config as cms from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer basicGenParticleValidation = DQMEDAnalyzer('BasicGenParticleValidation', hepmcCollection = cms.InputTag("generatorSmeared"), genparticleCollection = cms.InputTag("genParticles",""), genjetsColle...
import FWCore.ParameterSet.Config as cms from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer basicGenParticleValidation = DQMEDAnalyzer('BasicGenParticleValidation', hepmcCollection = cms.InputTag("generatorSmeared"), genparticleCollection = cms.InputTag("genParticles",""), genjetsCollection = cms.Inp...
none
1
1.377898
1
k_values_graph.py
leobouts/Skyline_top_k_queries
0
8832
<filename>k_values_graph.py from a_top_k import * from b_top_k import * import time def main(): # test the generator for the top-k input # starting time values_k = [1, 2, 5, 10, 20, 50, 100] times_topk_join_a = [] times_topk_join_b = [] number_of_valid_lines_a = [] number_of_valid_lines_...
<filename>k_values_graph.py from a_top_k import * from b_top_k import * import time def main(): # test the generator for the top-k input # starting time values_k = [1, 2, 5, 10, 20, 50, 100] times_topk_join_a = [] times_topk_join_b = [] number_of_valid_lines_a = [] number_of_valid_lines_...
en
0.598651
# test the generator for the top-k input # starting time
2.951339
3
AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_methodattrs.py
CEOALT1/RefindPlusUDK
2,757
8833
<reponame>CEOALT1/RefindPlusUDK<gh_stars>1000+ """Fix bound method attributes (method.im_? -> method.__?__). """ # Author: <NAME> # Local imports from .. import fixer_base from ..fixer_util import Name MAP = { "im_func" : "__func__", "im_self" : "__self__", "im_class" : "__self__.__class__" ...
"""Fix bound method attributes (method.im_? -> method.__?__). """ # Author: <NAME> # Local imports from .. import fixer_base from ..fixer_util import Name MAP = { "im_func" : "__func__", "im_self" : "__self__", "im_class" : "__self__.__class__" } class FixMethodattrs(fixer_base.BaseFix)...
en
0.333115
Fix bound method attributes (method.im_? -> method.__?__). # Author: <NAME> # Local imports power< any+ trailer< '.' attr=('im_func' | 'im_self' | 'im_class') > any* >
2.31207
2
models/TextCNN/cnn2d.py
Renovamen/Text-Classification
72
8834
<reponame>Renovamen/Text-Classification<filename>models/TextCNN/cnn2d.py<gh_stars>10-100 import torch import torch.nn as nn import torch.nn.functional as F from typing import List class TextCNN2D(nn.Module): """ Implementation of 2D version of TextCNN proposed in paper [1]. `Here <https://github.com/yoonk...
import torch import torch.nn as nn import torch.nn.functional as F from typing import List class TextCNN2D(nn.Module): """ Implementation of 2D version of TextCNN proposed in paper [1]. `Here <https://github.com/yoonkim/CNN_sentence>`_ is the official implementation of TextCNN. Parameters ---...
en
0.607538
Implementation of 2D version of TextCNN proposed in paper [1]. `Here <https://github.com/yoonkim/CNN_sentence>`_ is the official implementation of TextCNN. Parameters ---------- n_classes : int Number of classes vocab_size : int Number of words in the vocabulary embedding...
3.489628
3
LEVEL2/다리를지나는트럭/solution.py
seunghwanly/CODING-TEST
0
8835
def solution(bridge_length, weight, truck_weights): answer = 0 # { weight, time } wait = truck_weights[:] bridge = [] passed = 0 currWeight = 0 while True: if passed == len(truck_weights) and len(wait) == 0: return answer answer += 1 # sth needs to be passed ...
def solution(bridge_length, weight, truck_weights): answer = 0 # { weight, time } wait = truck_weights[:] bridge = [] passed = 0 currWeight = 0 while True: if passed == len(truck_weights) and len(wait) == 0: return answer answer += 1 # sth needs to be passed ...
en
0.808966
# { weight, time } # sth needs to be passed # add new truck # print(solution(2, 10, [7, 4, 5, 6]))
3.582555
4
heat/tests/convergence/framework/testutils.py
maestro-hybrid-cloud/heat
0
8836
<gh_stars>0 # # 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 or agreed to in writing, s...
# # 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 or agreed to in writing, software # ...
en
0.859194
# # 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 or agreed to in writing, software # ...
1.964841
2
device_geometry.py
AstroShen/fpga21-scaled-tech
2
8837
"""Holds the device gemoetry parameters (Table 5), taken from Wu et al., >> A Predictive 3-D Source/Drain Resistance Compact Model and the Impact on 7 nm and Scaled FinFets<<, 2020, with interpolation for 4nm. 16nm is taken from PTM HP. """ node_names = [16, 7, 5, 4, 3] GP = [64, 56, 48, 44, 41] FP = [40, 30, 28, 24, ...
"""Holds the device gemoetry parameters (Table 5), taken from Wu et al., >> A Predictive 3-D Source/Drain Resistance Compact Model and the Impact on 7 nm and Scaled FinFets<<, 2020, with interpolation for 4nm. 16nm is taken from PTM HP. """ node_names = [16, 7, 5, 4, 3] GP = [64, 56, 48, 44, 41] FP = [40, 30, 28, 24, ...
en
0.782484
Holds the device gemoetry parameters (Table 5), taken from Wu et al., >> A Predictive 3-D Source/Drain Resistance Compact Model and the Impact on 7 nm and Scaled FinFets<<, 2020, with interpolation for 4nm. 16nm is taken from PTM HP.
1.095154
1
nova/tests/servicegroup/test_zk_driver.py
vmthunder/nova
7
8838
# Copyright (c) AT&T 2012-2013 <NAME> <<EMAIL>> # Copyright 2012 IBM Corp. # # 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 # # ...
# Copyright (c) AT&T 2012-2013 <NAME> <<EMAIL>> # Copyright 2012 IBM Corp. # # 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 # # ...
en
0.825054
# Copyright (c) AT&T 2012-2013 <NAME> <<EMAIL>> # Copyright 2012 IBM Corp. # # 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 # # ...
1.843293
2
tests/test_misc.py
lordmauve/chopsticks
171
8839
"""Tests for miscellaneous properties, such as debuggability.""" import time from chopsticks.tunnel import Docker from chopsticks.group import Group def test_tunnel_repr(): """Tunnels have a usable repr.""" tun = Docker('py36', image='python:3.6') assert repr(tun) == "Docker('py36')" def test_group_repr...
"""Tests for miscellaneous properties, such as debuggability.""" import time from chopsticks.tunnel import Docker from chopsticks.group import Group def test_tunnel_repr(): """Tunnels have a usable repr.""" tun = Docker('py36', image='python:3.6') assert repr(tun) == "Docker('py36')" def test_group_repr...
en
0.96398
Tests for miscellaneous properties, such as debuggability. Tunnels have a usable repr. Groups have a usable repr. We can re-use a group.
2.678924
3
Evaluation/PostProcesing.py
AnnonymousRacoon/Quantum-Random-Walks-to-Solve-Diffusion
0
8840
<reponame>AnnonymousRacoon/Quantum-Random-Walks-to-Solve-Diffusion<gh_stars>0 import pandas as pd import re import glob def rebuild_counts_from_csv(path,n_dims, shots): df = pd.read_csv(path) return rebuild_counts_from_dataframe(dataframe=df, n_dims=n_dims, shots=shots) def rebuild_counts_from_dataframe(dat...
import pandas as pd import re import glob def rebuild_counts_from_csv(path,n_dims, shots): df = pd.read_csv(path) return rebuild_counts_from_dataframe(dataframe=df, n_dims=n_dims, shots=shots) def rebuild_counts_from_dataframe(dataframe,n_dims,shots): dimension_counts = {} for dimension in range(n_d...
en
0.305122
# print(dataframe["dimension_0"][idx]) # # print(dimension_counts)
2.795626
3
app/wirecard/tasks.py
michel-rodrigues/viggio_backend
0
8841
<gh_stars>0 from sentry_sdk import capture_exception from dateutil.parser import parse from project_configuration.celery import app from orders.models import Charge from request_shoutout.domain.models import Charge as DomainCharge from .models import WirecardTransactionData CROSS_SYSTEMS_STATUS_MAPPING = { 'WAI...
from sentry_sdk import capture_exception from dateutil.parser import parse from project_configuration.celery import app from orders.models import Charge from request_shoutout.domain.models import Charge as DomainCharge from .models import WirecardTransactionData CROSS_SYSTEMS_STATUS_MAPPING = { 'WAITING': Domai...
pt
0.999087
# Algumas vezes tem subido essa exceção, como não sabemos se é devido à falhas na sandbox # da wirecard, estamos evitando quebrar a aplicação e enviando a exceção para o sentry
1.889436
2
py/multiple_dispatch_example.py
coalpha/coalpha.github.io
0
8842
<filename>py/multiple_dispatch_example.py from typing import * from multiple_dispatch import multiple_dispatch @overload @multiple_dispatch def add(a: Literal[4, 6, 8], b): raise TypeError("No adding 2, 4, 6, or 8!") @overload @multiple_dispatch def add(a: int, b: str): return f"int + str = {a} + {b}" @overloa...
<filename>py/multiple_dispatch_example.py from typing import * from multiple_dispatch import multiple_dispatch @overload @multiple_dispatch def add(a: Literal[4, 6, 8], b): raise TypeError("No adding 2, 4, 6, or 8!") @overload @multiple_dispatch def add(a: int, b: str): return f"int + str = {a} + {b}" @overloa...
none
1
3.509457
4
dygraph/alexnet/network.py
Sunyingbin/models
0
8843
<gh_stars>0 """ 动态图构建 AlexNet """ import paddle.fluid as fluid import numpy as np class Conv2D(fluid.dygraph.Layer): def __init__(self, name_scope, num_channels, num_filters, filter_size, stride=1, pa...
""" 动态图构建 AlexNet """ import paddle.fluid as fluid import numpy as np class Conv2D(fluid.dygraph.Layer): def __init__(self, name_scope, num_channels, num_filters, filter_size, stride=1, padding=0, ...
ja
0.393774
动态图构建 AlexNet
2.973459
3
turtlegameproject/turtlegame.py
Ayon134/code_for_Kids
0
8844
import turtle import random p1=turtle.Turtle() p1.color("green") p1.shape("turtle") p1.penup() p1.goto(-200,100) p2=p1.clone() p2.color("blue") p2.penup() p2.goto(-200,-100) p1.goto(300,60) p1.pendown() p1.circle(40) p1.penup() p1.goto(-200,100) p2.goto(300,-140) p2.pendown() p2.circle(40) p2.penup() p2.goto(-200,-...
import turtle import random p1=turtle.Turtle() p1.color("green") p1.shape("turtle") p1.penup() p1.goto(-200,100) p2=p1.clone() p2.color("blue") p2.penup() p2.goto(-200,-100) p1.goto(300,60) p1.pendown() p1.circle(40) p1.penup() p1.goto(-200,100) p2.goto(300,-140) p2.pendown() p2.circle(40) p2.penup() p2.goto(-200,-...
none
1
3.884433
4
hivwholeseq/sequencing/check_pipeline.py
neherlab/hivwholeseq
3
8845
#!/usr/bin/env python # vim: fdm=marker ''' author: <NAME> date: 15/06/14 content: Check the status of the pipeline for one or more sequencing samples. ''' # Modules import os import sys from itertools import izip import argparse from Bio import SeqIO from hivwholeseq.utils.generic import getchar from hiv...
#!/usr/bin/env python # vim: fdm=marker ''' author: <NAME> date: 15/06/14 content: Check the status of the pipeline for one or more sequencing samples. ''' # Modules import os import sys from itertools import izip import argparse from Bio import SeqIO from hivwholeseq.utils.generic import getchar from hiv...
en
0.672106
#!/usr/bin/env python # vim: fdm=marker author: <NAME> date: 15/06/14 content: Check the status of the pipeline for one or more sequencing samples. # Modules # Globals # Functions Check for a sample a certain step of the pipeline at a certain detail # Check whether the mapped filtered is older than the map...
2.410825
2
app.py
thliang01/nba-s
0
8846
<gh_stars>0 import streamlit as st import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt # -------------------------------------------------------------- # Import and clean data game_details = pd.read_csv('games_details.csv') # print(game_details.head(5)) game_details.drop(['GAME...
import streamlit as st import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt # -------------------------------------------------------------- # Import and clean data game_details = pd.read_csv('games_details.csv') # print(game_details.head(5)) game_details.drop(['GAME_ID', 'TEAM_...
en
0.343465
# -------------------------------------------------------------- # Import and clean data # print(game_details.head(5)) # game_details.shape # game_details.info() # -------------------------------------------------------------- # My first app Hello *world!*
3.370561
3
python/craftassist/voxel_models/geoscorer/geoscorer_util.py
kepolol/craftassist
0
8847
<gh_stars>0 """ Copyright (c) Facebook, Inc. and its affiliates. """ import numpy as np import random from datetime import datetime import sys import argparse import torch import os from inspect import currentframe, getframeinfo GEOSCORER_DIR = os.path.dirname(os.path.realpath(__file__)) CRAFTASSIST_DIR = os.path.joi...
""" Copyright (c) Facebook, Inc. and its affiliates. """ import numpy as np import random from datetime import datetime import sys import argparse import torch import os from inspect import currentframe, getframeinfo GEOSCORER_DIR = os.path.dirname(os.path.realpath(__file__)) CRAFTASSIST_DIR = os.path.join(GEOSCORER_...
en
0.797339
Copyright (c) Facebook, Inc. and its affiliates. ## Train Fxns ## Takes a list of BATCHSIZE lists of tensors of length D. Returns a list of length D of batched tensors. ## 3D Utils ## Bounds should be a list of [min_x, max_x, min_y, max_y, min_z, max_z]. Returns a list of the side lengths. Takes a 3D coordinate...
1.993962
2
CryptoAttacks/tests/Block/test_gcm.py
akbarszcz/CryptoAttacks
54
8848
<gh_stars>10-100 #!/usr/bin/python from __future__ import absolute_import, division, print_function import subprocess from builtins import bytes, range from os.path import abspath, dirname from os.path import join as join_path from random import randint from CryptoAttacks.Block.gcm import * from CryptoAttacks.Utils...
#!/usr/bin/python from __future__ import absolute_import, division, print_function import subprocess from builtins import bytes, range from os.path import abspath, dirname from os.path import join as join_path from random import randint from CryptoAttacks.Block.gcm import * from CryptoAttacks.Utils import log def...
en
0.79597
#!/usr/bin/python factorization: [(poly1, power), (poly2, power)] # try found auth key candidates
2.158551
2
python_clean_architecture/use_cases/orderdata_use_case.py
jfsolarte/python_clean_architecture
0
8849
<gh_stars>0 from python_clean_architecture.shared import use_case as uc from python_clean_architecture.shared import response_object as res class OrderDataGetUseCase(uc.UseCase): def __init__(self, repo): self.repo = repo def execute(self, request_object): #if not request_object: ...
from python_clean_architecture.shared import use_case as uc from python_clean_architecture.shared import response_object as res class OrderDataGetUseCase(uc.UseCase): def __init__(self, repo): self.repo = repo def execute(self, request_object): #if not request_object: #return res...
en
0.57002
#if not request_object: #return res.ResponseFailure.build_from_invalid_request_object(request_object)
2.369828
2
owscapable/swe/common.py
b-cube/OwsCapable
1
8850
<filename>owscapable/swe/common.py from __future__ import (absolute_import, division, print_function) from owscapable.util import nspath_eval from owscapable.namespaces import Namespaces from owscapable.util import testXMLAttribute, testXMLValue, InfiniteDateTime, NegativeInfiniteDateTime from dateutil import parser ...
<filename>owscapable/swe/common.py from __future__ import (absolute_import, division, print_function) from owscapable.util import nspath_eval from owscapable.namespaces import Namespaces from owscapable.util import testXMLAttribute, testXMLValue, InfiniteDateTime, NegativeInfiniteDateTime from dateutil import parser ...
en
0.356925
# No call to super(), the type object will process that. # Revert to the content if attribute does not exists # Attributes # string, optional # Elements # anyType, min=0, max=X # Elements # anyURI, min=0 # string, min=0 # string, min=0 # Attributes # anyURI, required # boolean, optional # boolean, default=False # Attri...
2.161804
2
main_fed.py
gao969/scaffold-dgc-clustering
0
8851
#!/usr/bin/env python # -*- coding: utf-8 -*- # Python version: 3.6 import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import copy import numpy as np from torchvision import datasets, transforms import torch import os import torch.distributed as dist from utils.sampling import mnist_iid, mnist_non...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Python version: 3.6 import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import copy import numpy as np from torchvision import datasets, transforms import torch import os import torch.distributed as dist from utils.sampling import mnist_iid, mnist_non...
de
0.184808
#!/usr/bin/env python # -*- coding: utf-8 -*- # Python version: 3.6 # __name__是内置的变量,在执行当前文件(main_fed.py)时,默认值为__main__ # 但是如果其他.py文件import当前文件(main_fed.py)时,在其他文件中执行main_fed.py中的__name__,此时main_fed.py中的__name__默认值为文件名main_fed.py # parse args # if torch.cuda.is_available() and args.gpu != -1 else 'cpu' # load dataset a...
2.147085
2
b_lambda_layer_common_test/integration/infrastructure/function_with_unit_tests.py
gkazla/B.LambdaLayerCommon
0
8852
from aws_cdk.aws_lambda import Function, Code, Runtime from aws_cdk.core import Stack, Duration from b_aws_testing_framework.tools.cdk_testing.testing_stack import TestingStack from b_cfn_lambda_layer.package_version import PackageVersion from b_lambda_layer_common.layer import Layer from b_lambda_layer_common_test.un...
from aws_cdk.aws_lambda import Function, Code, Runtime from aws_cdk.core import Stack, Duration from b_aws_testing_framework.tools.cdk_testing.testing_stack import TestingStack from b_cfn_lambda_layer.package_version import PackageVersion from b_lambda_layer_common.layer import Layer from b_lambda_layer_common_test.un...
en
0.938411
Function that lets us run unit tests inside lambda function. We want to run unit tests both locally and remotely. # These dependencies are required for running unit tests inside lambda functions. # Pytest is used for running actual unit tests. # Pook is used for HTTP mocking, therefore it is also needed here. # Not...
2.196634
2
tests/metarl/tf/baselines/test_baselines.py
neurips2020submission11699/metarl
2
8853
<reponame>neurips2020submission11699/metarl """ This script creates a test that fails when metarl.tf.baselines failed to initialize. """ import tensorflow as tf from metarl.envs import MetaRLEnv from metarl.tf.baselines import ContinuousMLPBaseline from metarl.tf.baselines import GaussianMLPBaseline from tests.fixture...
""" This script creates a test that fails when metarl.tf.baselines failed to initialize. """ import tensorflow as tf from metarl.envs import MetaRLEnv from metarl.tf.baselines import ContinuousMLPBaseline from metarl.tf.baselines import GaussianMLPBaseline from tests.fixtures import TfGraphTestCase from tests.fixtures...
en
0.585414
This script creates a test that fails when metarl.tf.baselines failed to initialize. Test the baseline initialization.
2.415685
2
api/files/api/app/monthly_report.py
trackit/trackit-legacy
2
8854
<reponame>trackit/trackit-legacy import jinja2 import json from send_email import send_email from app.models import User, MyResourcesAWS, db from app.es.awsdetailedlineitem import AWSDetailedLineitem from sqlalchemy import desc import subprocess import datetime from flask import render_template def monthly_html_templa...
import jinja2 import json from send_email import send_email from app.models import User, MyResourcesAWS, db from app.es.awsdetailedlineitem import AWSDetailedLineitem from sqlalchemy import desc import subprocess import datetime from flask import render_template def monthly_html_template(): template_dir = '/usr/tr...
none
1
2.375761
2
slow_tests/boot_test.py
rdturnermtl/mlpaper
9
8855
# <NAME> (<EMAIL>) from __future__ import division, print_function from builtins import range import numpy as np import scipy.stats as ss import mlpaper.constants as cc import mlpaper.mlpaper as bt import mlpaper.perf_curves as pc from mlpaper.classification import DEFAULT_NGRID, curve_boot from mlpaper.test_constan...
# <NAME> (<EMAIL>) from __future__ import division, print_function from builtins import range import numpy as np import scipy.stats as ss import mlpaper.constants as cc import mlpaper.mlpaper as bt import mlpaper.perf_curves as pc from mlpaper.classification import DEFAULT_NGRID, curve_boot from mlpaper.test_constan...
en
0.939979
# <NAME> (<EMAIL>) # Divide by number of test funcs # Note that we are not going multiple comparison correction between the # two sided and one sided tests. # Drawing more seeds than we need to be safe # Could also test distn with 1-sided KS test but this easier for now # Could also test distn with 1-sided KS test but ...
2.1556
2
TTBenchmark/check_benchmark.py
yuqil725/benchmark_lib
0
8856
def check_difference(): pass def update_benchmark(): pass
def check_difference(): pass def update_benchmark(): pass
none
1
0.855307
1
core/test/test_timeseries_study.py
ajmal017/amp
0
8857
from typing import Any, Dict import numpy as np import pandas as pd import core.artificial_signal_generators as sig_gen import core.statistics as stats import core.timeseries_study as tss import helpers.unit_test as hut class TestTimeSeriesDailyStudy(hut.TestCase): def test_usual_case(self) -> None: idx...
from typing import Any, Dict import numpy as np import pandas as pd import core.artificial_signal_generators as sig_gen import core.statistics as stats import core.timeseries_study as tss import helpers.unit_test as hut class TestTimeSeriesDailyStudy(hut.TestCase): def test_usual_case(self) -> None: idx...
none
1
2.42283
2
util.py
takat0m0/infoGAN
0
8858
<filename>util.py #! -*- coding:utf-8 -*- import os import sys import cv2 import numpy as np def _resizing(img): #return cv2.resize(img, (256, 256)) return cv2.resize(img, (32, 32)) def _reg(img): return img/127.5 - 1.0 def _re_reg(img): return (img + 1.0) * 127.5 def get_figs(target_dir): ret ...
<filename>util.py #! -*- coding:utf-8 -*- import os import sys import cv2 import numpy as np def _resizing(img): #return cv2.resize(img, (256, 256)) return cv2.resize(img, (32, 32)) def _reg(img): return img/127.5 - 1.0 def _re_reg(img): return (img + 1.0) * 127.5 def get_figs(target_dir): ret ...
en
0.362879
#! -*- coding:utf-8 -*- #return cv2.resize(img, (256, 256))
2.793318
3
myhoodApp/migrations/0002_healthfacilities_hospital_image.py
MutuaFranklin/MyHood
0
8859
<reponame>MutuaFranklin/MyHood # Generated by Django 3.2.7 on 2021-09-23 20:01 import cloudinary.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('myhoodApp', '0001_initial'), ] operations = [ migrations.AddField( model_name='h...
# Generated by Django 3.2.7 on 2021-09-23 20:01 import cloudinary.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('myhoodApp', '0001_initial'), ] operations = [ migrations.AddField( model_name='healthfacilities', n...
en
0.815358
# Generated by Django 3.2.7 on 2021-09-23 20:01
1.851888
2
forecasting_algorithms/Multiple_Timeseries/VAR/var.py
ans682/SafePredict_and_Forecasting
1
8860
# VAR example from statsmodels.tsa.vector_ar.var_model import VAR from random import random # contrived dataset with dependency data = list() for i in range(100): v1 = i + random() v2 = v1 + random() row = [v1, v2] data.append(row) # fit model model = VAR(data) model_fit = model.fit() # make prediction ...
# VAR example from statsmodels.tsa.vector_ar.var_model import VAR from random import random # contrived dataset with dependency data = list() for i in range(100): v1 = i + random() v2 = v1 + random() row = [v1, v2] data.append(row) # fit model model = VAR(data) model_fit = model.fit() # make prediction ...
en
0.798805
# VAR example # contrived dataset with dependency # fit model # make prediction
2.979384
3
candidate-scrape.py
jonykarki/hamroscraper
2
8861
<reponame>jonykarki/hamroscraper<filename>candidate-scrape.py import json import urllib.request import MySQLdb db = MySQLdb.connect(host="localhost", # your host, usually localhost user="root", # your username passwd="", # your password db="elec...
import json import urllib.request import MySQLdb db = MySQLdb.connect(host="localhost", # your host, usually localhost user="root", # your username passwd="", # your password db="election") cur = db.cursor() # user_agent for sending headers w...
en
0.675548
# your host, usually localhost # your username # your password # user_agent for sending headers with the request # header # print(source) #print(data['candidates']['2']['400'][0]['cName']) # get all the possible election-areas from the district # data needed for the database resultno :> autoincrement constituencyname :...
3.259907
3
sangita/hindi/lemmatizer.py
ashiscs/sangita
36
8862
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 9 23:28:21 2017 @author: samriddhi """ import re import sangita.hindi.tokenizer as tok import sangita.hindi.corpora.lemmata as lt def numericLemmatizer(instr): lst = type([1,2,3]) tup = type(("Hello", "Hi")) string = type("Hello") ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 9 23:28:21 2017 @author: samriddhi """ import re import sangita.hindi.tokenizer as tok import sangita.hindi.corpora.lemmata as lt def numericLemmatizer(instr): lst = type([1,2,3]) tup = type(("Hello", "Hi")) string = type("Hello") ...
en
0.575727
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Fri Jun 9 23:28:21 2017 @author: samriddhi
3.42794
3
gslib/tests/test_stet_util.py
ttobisawa/gsutil
0
8863
<reponame>ttobisawa/gsutil<filename>gslib/tests/test_stet_util.py # -*- coding: utf-8 -*- # Copyright 2021 Google Inc. 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 # #...
# -*- coding: utf-8 -*- # Copyright 2021 Google Inc. 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/LICENSE-2.0 # # Unless require...
en
0.834239
# -*- coding: utf-8 -*- # Copyright 2021 Google Inc. 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/LICENSE-2.0 # # Unless require...
1.95908
2
markdown_editing/tests/test_extension.py
makyo/markdown-editing
0
8864
<reponame>makyo/markdown-editing<gh_stars>0 from markdown import markdown from unittest import TestCase from markdown_editing.extension import EditingExtension class TestExtension(TestCase): def test_substitution(self): source = '~{out with the old}{in with the new}' expected = '<p><span class="...
from markdown import markdown from unittest import TestCase from markdown_editing.extension import EditingExtension class TestExtension(TestCase): def test_substitution(self): source = '~{out with the old}{in with the new}' expected = '<p><span class="substitution"><del>out with the old</del><in...
en
0.601168
# Only need to test this once. * Substitution: ~{out with the old}{in with the new} * With comment: ~{out with the old}{in with the new}(is what I always say) * With attribution: ~{out with the old}{in with the new}(is what I always say (Makyo)) * With date: ~{out with the old}{in with the new}(is what I always say (Ma...
2.776137
3
apps/siren/test_handlers.py
thomasyi17/diana2
15
8865
""" SIREN/DIANA basic functionality testing framework Requires env vars: - GMAIL_USER - GMAIL_APP_PASSWORD - GMAIL_BASE_NAME -- ie, abc -> <EMAIL> These env vars are set to default: - ORTHANC_PASSWORD - SPLUNK_PASSWORD - SPLUNK_HEC_TOKEN TODO: Move stuff to archive after collected TODO: Write data into daily folder...
""" SIREN/DIANA basic functionality testing framework Requires env vars: - GMAIL_USER - GMAIL_APP_PASSWORD - GMAIL_BASE_NAME -- ie, abc -> <EMAIL> These env vars are set to default: - ORTHANC_PASSWORD - SPLUNK_PASSWORD - SPLUNK_HEC_TOKEN TODO: Move stuff to archive after collected TODO: Write data into daily folder...
en
0.576554
SIREN/DIANA basic functionality testing framework Requires env vars: - GMAIL_USER - GMAIL_APP_PASSWORD - GMAIL_BASE_NAME -- ie, abc -> <EMAIL> These env vars are set to default: - ORTHANC_PASSWORD - SPLUNK_PASSWORD - SPLUNK_HEC_TOKEN TODO: Move stuff to archive after collected TODO: Write data into daily folder or ...
1.641462
2
deptree.py
jeking3/boost-deptree
0
8866
<gh_stars>0 # # Copyright (c) 2019 <NAME> # # Use, modification, and distribution are subject to the # Boost Software License, Version 1.0. (See accompanying file # LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) # import json import networkx import re from pathlib import Path class BoostDependency...
# # Copyright (c) 2019 <NAME> # # Use, modification, and distribution are subject to the # Boost Software License, Version 1.0. (See accompanying file # LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) # import json import networkx import re from pathlib import Path class BoostDependencyTree(object)...
en
0.810133
# # Copyright (c) 2019 <NAME> # # Use, modification, and distribution are subject to the # Boost Software License, Version 1.0. (See accompanying file # LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) # Generates a PlantUML dependency tree to visualize the dependencies. One of the benefits of gen...
2.234292
2
uberbackend.py
adiHusky/uber_backend
0
8867
<reponame>adiHusky/uber_backend from flask import Flask, flash, request, jsonify, render_template, redirect, url_for, g, session, send_from_directory, abort from flask_cors import CORS # from flask import status from datetime import date, datetime, timedelta from calendar import monthrange from dateutil.parser import p...
from flask import Flask, flash, request, jsonify, render_template, redirect, url_for, g, session, send_from_directory, abort from flask_cors import CORS # from flask import status from datetime import date, datetime, timedelta from calendar import monthrange from dateutil.parser import parse import pytz import os impor...
en
0.545229
# from flask import status # straight mongo access # Set traces_sample_rate to 1.0 to capture 100% # of transactions for performance monitoring. # We recommend adjusting this value in production. # By default the SDK will try to use the SENTRY_RELEASE # environment variable, or infer a git commit # SHA as release, howe...
1.937294
2
sppas/sppas/src/models/acm/htkscripts.py
mirfan899/MTTS
0
8868
<reponame>mirfan899/MTTS """ .. --------------------------------------------------------------------- ___ __ __ __ ___ / | \ | \ | \ / the automatic \__ |__/ |__/ |___| \__ annotation and \ | | | | \ ...
""" .. --------------------------------------------------------------------- ___ __ __ __ ___ / | \ | \ | \ / the automatic \__ |__/ |__/ |___| \__ annotation and \ | | | | \ analysis ___/...
en
0.580576
.. --------------------------------------------------------------------- ___ __ __ __ ___ / | \ | \ | \ / the automatic \__ |__/ |__/ |___| \__ annotation and \ | | | | \ analysis ___/ | ...
1.467779
1
icekit/plugins/map/tests.py
ic-labs/django-icekit
52
8869
from mock import patch from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.contrib.auth import get_user_model from django.core import exceptions from django_dynamic_fixture import G from django_webtest import WebTest from icekit.models import Layout from...
from mock import patch from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.contrib.auth import get_user_model from django.core import exceptions from django_dynamic_fixture import G from django_webtest import WebTest from icekit.models import Layout from...
en
0.337118
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3312.0476344648832!2d151.19845715159963!3d-33.88842702741586!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6b12b1d842ee9aa9%3A0xb0a19ac433ef0be8!2sThe+Interaction+Consortium!5e0!3m2!1sen!2sau!4v1496201264670" widt...
1.873873
2
example/example.py
saravanabalagi/imshowtools
4
8870
<gh_stars>1-10 from imshowtools import imshow import cv2 if __name__ == '__main__': image_lenna = cv2.imread("lenna.png") imshow(image_lenna, mode='BGR', window_title="LennaWindow", title="Lenna") image_lenna_bgr = cv2.imread("lenna_bgr.png") imshow(image_lenna, image_lenna_bgr, mode=['BGR', 'RGB'],...
from imshowtools import imshow import cv2 if __name__ == '__main__': image_lenna = cv2.imread("lenna.png") imshow(image_lenna, mode='BGR', window_title="LennaWindow", title="Lenna") image_lenna_bgr = cv2.imread("lenna_bgr.png") imshow(image_lenna, image_lenna_bgr, mode=['BGR', 'RGB'], title=['lenna_...
none
1
3.106779
3
terminalone/models/concept.py
amehta1/t1-python
24
8871
# -*- coding: utf-8 -*- """Provides concept object.""" from __future__ import absolute_import from .. import t1types from ..entity import Entity class Concept(Entity): """Concept entity.""" collection = 'concepts' resource = 'concept' _relations = { 'advertiser', } _pull = { '...
# -*- coding: utf-8 -*- """Provides concept object.""" from __future__ import absolute_import from .. import t1types from ..entity import Entity class Concept(Entity): """Concept entity.""" collection = 'concepts' resource = 'concept' _relations = { 'advertiser', } _pull = { '...
en
0.888859
# -*- coding: utf-8 -*- Provides concept object. Concept entity.
2.341564
2
videofeed.py
dmeklund/asyncdemo
0
8872
""" Mock up a video feed pipeline """ import asyncio import logging import sys import cv2 logging.basicConfig(format="[%(thread)-5d]%(asctime)s: %(message)s") logger = logging.getLogger('async') logger.setLevel(logging.INFO) async def process_video(filename): cap = cv2.VideoCapture(filename) tasks = list() ...
""" Mock up a video feed pipeline """ import asyncio import logging import sys import cv2 logging.basicConfig(format="[%(thread)-5d]%(asctime)s: %(message)s") logger = logging.getLogger('async') logger.setLevel(logging.INFO) async def process_video(filename): cap = cv2.VideoCapture(filename) tasks = list() ...
en
0.765273
Mock up a video feed pipeline
3.135046
3
parsers/read_lspci_and_glxinfo.py
mikeus9908/peracotta
3
8873
#!/usr/bin/python3 """ Read "lspci -v" and "glxinfo" outputs """ import re from dataclasses import dataclass from InputFileNotFoundError import InputFileNotFoundError @dataclass class VideoCard: type = "graphics-card" manufacturer_brand = "" reseller_brand = "" internal_name = "" model = "" ...
#!/usr/bin/python3 """ Read "lspci -v" and "glxinfo" outputs """ import re from dataclasses import dataclass from InputFileNotFoundError import InputFileNotFoundError @dataclass class VideoCard: type = "graphics-card" manufacturer_brand = "" reseller_brand = "" internal_name = "" model = "" ...
en
0.752305
#!/usr/bin/python3 Read "lspci -v" and "glxinfo" outputs # bytes # removes "VGA compatible controller:" # take the first string between [] from the first line # there may not be an argument in between [] # The model or model family is often repeated here, but removing it automatically is complicated # -----------------...
2.980895
3
upload.py
snymainn/tools-
0
8874
<reponame>snymainn/tools-<gh_stars>0 #!/usr/bin/python import sys from loglib import SNYLogger import ftplib import argparse import re import os import calendar import time def read_skipfile(infile, log): skiplines = list() skipfile = open(infile, 'r') for line in skipfile: newline = line.rst...
#!/usr/bin/python import sys from loglib import SNYLogger import ftplib import argparse import re import os import calendar import time def read_skipfile(infile, log): skiplines = list() skipfile = open(infile, 'r') for line in skipfile: newline = line.rstrip('\r\n') linelength = len(...
en
0.88191
#!/usr/bin/python #GET LOCAL FILELIST # # login to ftp server # # # get remote files # # LIST CONTENTS # Entry point # log.debug(line) #Set this because directories does not report size #for loops/if checks are not blocks in python, i.e. no need to predefine modify #If string does not contain =, cell[1] will...
2.776386
3
chapter2/intogen-arrays/src/mrna/mrna_comb_gene_classif.py
chris-zen/phd-thesis
1
8875
#!/usr/bin/env python """ Classify oncodrive gene results and prepare for combination * Configuration parameters: - The ones required by intogen.data.entity.EntityManagerFactory * Input: - oncodrive_ids: The mrna.oncodrive_genes to process * Output: - combinations: The mrna.combination prepared to be calculated ...
#!/usr/bin/env python """ Classify oncodrive gene results and prepare for combination * Configuration parameters: - The ones required by intogen.data.entity.EntityManagerFactory * Input: - oncodrive_ids: The mrna.oncodrive_genes to process * Output: - combinations: The mrna.combination prepared to be calculated ...
en
0.595995
#!/usr/bin/env python Classify oncodrive gene results and prepare for combination * Configuration parameters: - The ones required by intogen.data.entity.EntityManagerFactory * Input: - oncodrive_ids: The mrna.oncodrive_genes to process * Output: - combinations: The mrna.combination prepared to be calculated * En...
2.292009
2
src/FunctionApps/DevOps/tests/test_get_ip.py
CDCgov/prime-public-health-data-infrastructure
3
8876
def test_get_ip_placeholder(): """placeholder so pytest does not fail""" pass
def test_get_ip_placeholder(): """placeholder so pytest does not fail""" pass
en
0.838032
placeholder so pytest does not fail
1.20992
1
data/models/svm_benchmark.py
Laurenhut/Machine_Learning_Final
0
8877
<gh_stars>0 #!/usr/bin/env python from sklearn import svm import csv_io def main(): training, target = csv_io.read_data("../Data/train.csv") training = [x[1:] for x in training] target = [float(x) for x in target] test, throwaway = csv_io.read_data("../Data/test.csv") test = [x[1:] for x in test] ...
#!/usr/bin/env python from sklearn import svm import csv_io def main(): training, target = csv_io.read_data("../Data/train.csv") training = [x[1:] for x in training] target = [float(x) for x in target] test, throwaway = csv_io.read_data("../Data/test.csv") test = [x[1:] for x in test] svc = s...
en
0.583503
#!/usr/bin/env python # svc.fit(training, target) # predicted_probs = svc.predict_proba(test) # predicted_probs = [[min(max(x,0.001),0.999) for x in y] # for y in predicted_probs] # predicted_probs = [["%f" % x for x in y] for y in predicted_probs] # csv_io.write_delimited_file("../Submissions/svm_be...
2.931732
3
configs/utils/config_generator.py
user-wu/SOD_eval_metrics
0
8878
<reponame>user-wu/SOD_eval_metrics<gh_stars>0 # -*- coding: utf-8 -*- from matplotlib import colors # max = 148 _COLOR_Genarator = iter( sorted( [ color for name, color in colors.cnames.items() if name not in ["red", "white"] or not name.startswith("light") or "gray" in...
# -*- coding: utf-8 -*- from matplotlib import colors # max = 148 _COLOR_Genarator = iter( sorted( [ color for name, color in colors.cnames.items() if name not in ["red", "white"] or not name.startswith("light") or "gray" in name ] ) ) def curve_info_gener...
en
0.59024
# -*- coding: utf-8 -*- # max = 148 # line_style_flag = not line_style_flag
2.372807
2
core/sms_service.py
kartik1000/jcc-registration-portal
0
8879
<reponame>kartik1000/jcc-registration-portal<filename>core/sms_service.py<gh_stars>0 from urllib.parse import urlencode from decouple import config import hashlib import requests BASE = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" auth_key = config('AUTH_KEY') url = 'http://sms.globehost.com/api/se...
from urllib.parse import urlencode from decouple import config import hashlib import requests BASE = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" auth_key = config('AUTH_KEY') url = 'http://sms.globehost.com/api/sendhttp.php?' def encode_base(num, array=BASE): if(num == 0): return arr...
none
1
2.571455
3
scripts/fetch_images.py
Protagonistss/sanic-for-v3
0
8880
<reponame>Protagonistss/sanic-for-v3 import sys import os sys.path.append(os.pardir) import random import time import requests from contextlib import closing from help import utils from threading import Thread def get_train_set_path(path: str): create_path = utils.join_root_path(path) return create_path d...
import sys import os sys.path.append(os.pardir) import random import time import requests from contextlib import closing from help import utils from threading import Thread def get_train_set_path(path: str): create_path = utils.join_root_path(path) return create_path def create_train_set_dir(path='auth-se...
none
1
2.531138
3
GeneralStats/example.py
haoruilee/statslibrary
58
8881
import GeneralStats as gs import numpy as np from scipy.stats import skew from scipy.stats import kurtosistest import pandas as pd if __name__ == "__main__": gen=gs.GeneralStats() data=np.array([[1, 1, 2, 2, 3],[2, 2, 3, 3, 5],[1, 4, 3, 3, 3],[2, 4, 5, 5, 3]]) data1=np.array([1,2,3,4,5]) ...
import GeneralStats as gs import numpy as np from scipy.stats import skew from scipy.stats import kurtosistest import pandas as pd if __name__ == "__main__": gen=gs.GeneralStats() data=np.array([[1, 1, 2, 2, 3],[2, 2, 3, 3, 5],[1, 4, 3, 3, 3],[2, 4, 5, 5, 3]]) data1=np.array([1,2,3,4,5]) ...
zh
0.761161
#若元素个数为偶数,则模式为'midpoint'的0.5分位数值等价于中位数 #若元素个数为奇数,则模式为'lower'的0.5分位数值等价于中位数
2.691244
3
bootstrap.py
tqchen/yarn-ec2
35
8882
<gh_stars>10-100 #!/usr/bin/env python # encoding: utf-8 """ script to install all the necessary things for working on a linux machine with nothing Installing minimum dependencies """ import sys import os import logging import subprocess import xml.etree.ElementTree as ElementTree import xml.dom.minidom as minidom imp...
#!/usr/bin/env python # encoding: utf-8 """ script to install all the necessary things for working on a linux machine with nothing Installing minimum dependencies """ import sys import os import logging import subprocess import xml.etree.ElementTree as ElementTree import xml.dom.minidom as minidom import socket import...
en
0.55248
#!/usr/bin/env python # encoding: utf-8 script to install all the necessary things for working on a linux machine with nothing Installing minimum dependencies ###---------------------------------------------------## # Configuration Section, will be modified by script # ###--------------------------------------------...
1.88631
2
intro/matplotlib/examples/plot_good.py
zmoon/scipy-lecture-notes
2,538
8883
""" A simple, good-looking plot =========================== Demoing some simple features of matplotlib """ import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt fig = plt.figure(figsize=(5, 4), dpi=72) axes = fig.add_axes([0.01, 0.01, .98, 0.98]) X = np.linspace(0, 2, 200) Y = np...
""" A simple, good-looking plot =========================== Demoing some simple features of matplotlib """ import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt fig = plt.figure(figsize=(5, 4), dpi=72) axes = fig.add_axes([0.01, 0.01, .98, 0.98]) X = np.linspace(0, 2, 200) Y = np...
en
0.741695
A simple, good-looking plot =========================== Demoing some simple features of matplotlib
3.696145
4
pfio/_context.py
HiroakiMikami/pfio
24
8884
import os import re from typing import Tuple from pfio._typing import Union from pfio.container import Container from pfio.io import IO, create_fs_handler class FileSystemDriverList(object): def __init__(self): # TODO(tianqi): dynamically create this list # as well as the patterns upon loading th...
import os import re from typing import Tuple from pfio._typing import Union from pfio.container import Container from pfio.io import IO, create_fs_handler class FileSystemDriverList(object): def __init__(self): # TODO(tianqi): dynamically create this list # as well as the patterns upon loading th...
en
0.753563
# TODO(tianqi): dynamically create this list # as well as the patterns upon loading the pfio module. # TODO(check) if root is directory
2.348954
2
parser/fase2/team19/Analisis_Ascendente/Instrucciones/PLPGSQL/Ifpl.py
Josue-Zea/tytus
35
8885
<filename>parser/fase2/team19/Analisis_Ascendente/Instrucciones/PLPGSQL/Ifpl.py import Analisis_Ascendente.Instrucciones.PLPGSQL.EjecutarFuncion as EjecutarFuncion from Analisis_Ascendente.Instrucciones.PLPGSQL.plasignacion import Plasignacion from Analisis_Ascendente.Instrucciones.instruccion import Instruccion fro...
<filename>parser/fase2/team19/Analisis_Ascendente/Instrucciones/PLPGSQL/Ifpl.py import Analisis_Ascendente.Instrucciones.PLPGSQL.EjecutarFuncion as EjecutarFuncion from Analisis_Ascendente.Instrucciones.PLPGSQL.plasignacion import Plasignacion from Analisis_Ascendente.Instrucciones.instruccion import Instruccion fro...
es
0.166141
#----------------------------------Imports FASE2-------------------------- #1 If #2 If elif else #3 If else # print("Ejecute un insert") # print("Ejecute drop") # print("Ejecute alter database") # print("Ejecute alter table") # print("Ejecute delete") # print("Ejecute Index") if %s: goto .%s <br> got...
1.420263
1
epages_client/dataobjects/enum_fetch_operator.py
vilkasgroup/epages_client
3
8886
# -*- coding: utf-8 -*- from __future__ import unicode_literals class FetchOperator(object): '''Defines values for fetch operators''' ADD = 1 REMOVE = 2 REPLACE = 3
# -*- coding: utf-8 -*- from __future__ import unicode_literals class FetchOperator(object): '''Defines values for fetch operators''' ADD = 1 REMOVE = 2 REPLACE = 3
en
0.54046
# -*- coding: utf-8 -*- Defines values for fetch operators
1.767618
2
pyhwpscan/hwp_scan.py
orca-eaa5a/dokkaebi_scanner
0
8887
from threading import current_thread from jsbeautifier.javascript.beautifier import remove_redundant_indentation from pyparser.oleparser import OleParser from pyparser.hwp_parser import HwpParser from scan.init_scan import init_hwp5_scan from scan.bindata_scanner import BinData_Scanner from scan.jscript_scanner import...
from threading import current_thread from jsbeautifier.javascript.beautifier import remove_redundant_indentation from pyparser.oleparser import OleParser from pyparser.hwp_parser import HwpParser from scan.init_scan import init_hwp5_scan from scan.bindata_scanner import BinData_Scanner from scan.jscript_scanner import...
en
0.126041
def parse_hwpdoc(self): try: self.hwp_parser = HwpParser(self.ole_parser) self.hwp_parser.parse() if not init_hwp5_scan(self.hwp_parser.hwp_header): exit(-1) except: self.hwpx_docs = zipfile.ZipFile(self.file_name, "r") ...
2.393603
2
tests/core/test_plugins.py
franalgaba/nile
0
8888
""" Tests for plugins in core module. Only unit tests for now. """ from unittest.mock import patch import click from nile.core.plugins import get_installed_plugins, load_plugins, skip_click_exit def test_skip_click_exit(): def dummy_method(a, b): return a + b dummy_result = dummy_method(1, 2) ...
""" Tests for plugins in core module. Only unit tests for now. """ from unittest.mock import patch import click from nile.core.plugins import get_installed_plugins, load_plugins, skip_click_exit def test_skip_click_exit(): def dummy_method(a, b): return a + b dummy_result = dummy_method(1, 2) ...
en
0.857956
Tests for plugins in core module. Only unit tests for now. Nile CLI group.
2.422254
2
commands/source.py
Open-Source-eUdeC/UdeCursos-bot
3
8889
async def source(update, context): source_code = "https://github.com/Open-Source-eUdeC/UdeCursos-bot" await context.bot.send_message( chat_id=update.effective_chat.id, text=( "*UdeCursos bot v2.0*\n\n" f"Código fuente: [GitHub]({source_code})" ), parse_mod...
async def source(update, context): source_code = "https://github.com/Open-Source-eUdeC/UdeCursos-bot" await context.bot.send_message( chat_id=update.effective_chat.id, text=( "*UdeCursos bot v2.0*\n\n" f"Código fuente: [GitHub]({source_code})" ), parse_mod...
none
1
1.735592
2
history/tests.py
MPIB/Lagerregal
24
8890
from django.contrib.contenttypes.models import ContentType from django.test import TestCase from django.test.client import Client from model_mommy import mommy from devices.models import Device from users.models import Lageruser class HistoryTests(TestCase): def setUp(self): self.client = Client() ...
from django.contrib.contenttypes.models import ContentType from django.test import TestCase from django.test.client import Client from model_mommy import mommy from devices.models import Device from users.models import Lageruser class HistoryTests(TestCase): def setUp(self): self.client = Client() ...
none
1
2.257052
2
django_git_info/management/commands/get_git_info.py
spapas/django-git
1
8891
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand, CommandError from django_git_info import get_git_info class Command(BaseCommand): help = 'Gets git info' #@transaction.commit_manually def handle(self, *args, **options): info = get_git_info() for key in info.ke...
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand, CommandError from django_git_info import get_git_info class Command(BaseCommand): help = 'Gets git info' #@transaction.commit_manually def handle(self, *args, **options): info = get_git_info() for key in info.ke...
en
0.684803
# -*- coding: utf-8 -*- #@transaction.commit_manually
2.179939
2
mevis/_internal/conversion.py
robert-haas/mevis
2
8892
<filename>mevis/_internal/conversion.py from collections.abc import Callable as _Callable import networkx as _nx from opencog.type_constructors import AtomSpace as _AtomSpace from .args import check_arg as _check_arg def convert(data, graph_annotated=True, graph_directed=True, node_label=None, node_colo...
<filename>mevis/_internal/conversion.py from collections.abc import Callable as _Callable import networkx as _nx from opencog.type_constructors import AtomSpace as _AtomSpace from .args import check_arg as _check_arg def convert(data, graph_annotated=True, graph_directed=True, node_label=None, node_colo...
en
0.819813
Convert an Atomspace or list of Atoms to a NetworkX graph with annotations. Several arguments accept a Callable. - In case of node annotations, the Callable gets an Atom as input, which the node represents in the graph. The Callable needs to return one of the other types accepted by the argument, ...
3.062774
3
testData/completion/classMethodCls.py
seandstewart/typical-pycharm-plugin
0
8893
<filename>testData/completion/classMethodCls.py from builtins import * from pydantic import BaseModel class A(BaseModel): abc: str @classmethod def test(cls): return cls.<caret>
<filename>testData/completion/classMethodCls.py from builtins import * from pydantic import BaseModel class A(BaseModel): abc: str @classmethod def test(cls): return cls.<caret>
none
1
2.073626
2
watcher_metering/tests/agent/test_agent.py
b-com/watcher-metering
2
8894
<filename>watcher_metering/tests/agent/test_agent.py<gh_stars>1-10 # -*- encoding: utf-8 -*- # Copyright (c) 2015 b<>com # # 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.apac...
<filename>watcher_metering/tests/agent/test_agent.py<gh_stars>1-10 # -*- encoding: utf-8 -*- # Copyright (c) 2015 b<>com # # 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.apac...
en
0.860716
# -*- encoding: utf-8 -*- # Copyright (c) 2015 b<>com # # 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 o...
1.858998
2
mmtbx/bulk_solvent/mosaic.py
ndevenish/cctbx_project
0
8895
from __future__ import absolute_import, division, print_function from cctbx.array_family import flex from scitbx import matrix import math from libtbx import adopt_init_args import scitbx.lbfgs from mmtbx.bulk_solvent import kbu_refinery from cctbx import maptbx import mmtbx.masks import boost_adaptbx.boost.python as b...
from __future__ import absolute_import, division, print_function from cctbx.array_family import flex from scitbx import matrix import math from libtbx import adopt_init_args import scitbx.lbfgs from mmtbx.bulk_solvent import kbu_refinery from cctbx import maptbx import mmtbx.masks import boost_adaptbx.boost.python as b...
en
0.327837
# Utilities used by algorithm 2 ------------------------------------------------ #print "step: %4d"%self.cntr, "target:", t, "params:", \ # " ".join(["%10.6f"%i for i in self.x]), math.log(t) #assert self.d.all_ne(0) #print "step: %4d"%self.cntr, "target:", self.f, "params:", \ # " ".join(["%10.6f"%i for i in self.x]...
1.469522
1
mars/tensor/execution/tests/test_base_execute.py
lmatz/mars
1
8896
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2018 Alibaba Group Holding Ltd. # # 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-...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2018 Alibaba Group Holding Ltd. # # 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-...
en
0.806685
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2018 Alibaba Group Holding Ltd. # # 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-...
1.804501
2
comix-imagenet/init_paths.py
drumpt/Co-Mixup
86
8897
import sys import matplotlib matplotlib.use('Agg') sys.path.insert(0, 'lib')
import sys import matplotlib matplotlib.use('Agg') sys.path.insert(0, 'lib')
none
1
1.212949
1
members_abundances_in_out_uncertainties.py
kcotar/Gaia_clusters_potential
0
8898
import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt from glob import glob from astropy.table import Table, join from os import chdir, system from scipy.stats import norm as gauss_norm from sys import argv from getopt import getopt # turn off polyfit ranking warnings import warnin...
import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt from glob import glob from astropy.table import Table, join from os import chdir, system from scipy.stats import norm as gauss_norm from sys import argv from getopt import getopt # turn off polyfit ranking warnings import warnin...
en
0.523231
# turn off polyfit ranking warnings # create and sum all PDF of stellar abundances # return normalized summed pdf of all stars # diffence to the original data # select data that will be fitted # number of sigma clipping steps # parse input options # set parameters, depending on user inputs # remove cluster members from...
2.298521
2
src/python_minifier/transforms/remove_pass.py
donno2048/python-minifier
0
8899
<reponame>donno2048/python-minifier import ast from python_minifier.transforms.suite_transformer import SuiteTransformer class RemovePass(SuiteTransformer): """ Remove Pass keywords from source If a statement is syntactically necessary, use an empty expression instead """ def __call__(self, nod...
import ast from python_minifier.transforms.suite_transformer import SuiteTransformer class RemovePass(SuiteTransformer): """ Remove Pass keywords from source If a statement is syntactically necessary, use an empty expression instead """ def __call__(self, node): return self.visit(node) ...
en
0.631282
Remove Pass keywords from source If a statement is syntactically necessary, use an empty expression instead
2.422449
2