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
import_data/mysql-connector-python-2.1.6/examples/transaction.py
bopopescu/nutrition
110
6630651
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- # MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2...
#!/usr/bin/env python # -*- coding: utf-8 -*- # MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most...
en
0.833099
#!/usr/bin/env python # -*- coding: utf-8 -*- # MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most #...
2.363405
2
cpdb/data_importer/copa_crawler/parser.py
invinst/CPDBv2_backend
25
6630652
<reponame>invinst/CPDBv2_backend<gh_stars>10-100 # -*- coding: utf-8 -*- from __future__ import unicode_literals from collections import OrderedDict from datetime import datetime import iso8601 import pytz from data.constants import AttachmentSourceType, MEDIA_TYPE_DOCUMENT class Field(object): pass class Jus...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from collections import OrderedDict from datetime import datetime import iso8601 import pytz from data.constants import AttachmentSourceType, MEDIA_TYPE_DOCUMENT class Field(object): pass class Just(Field): def __init__(self, value): ...
en
0.882
# -*- coding: utf-8 -*- # We accept the fact that no-value of string is ''. Should reconsider when we work with a complete solution to # differentiate between no-value and empty value. # FIXME: still return when we have value int(0)
2.910904
3
src/yellowdog_client/model/provisioned_worker_pool.py
yellowdog/yellowdog-sdk-python-public
0
6630653
from dataclasses import dataclass, field from datetime import datetime from typing import Optional from .node_summary import NodeSummary from .provisioned_worker_pool_properties import ProvisionedWorkerPoolProperties from .worker_pool import WorkerPool from .worker_pool_status import WorkerPoolStatus from .worker_summ...
from dataclasses import dataclass, field from datetime import datetime from typing import Optional from .node_summary import NodeSummary from .provisioned_worker_pool_properties import ProvisionedWorkerPoolProperties from .worker_pool import WorkerPool from .worker_pool_status import WorkerPoolStatus from .worker_summ...
en
0.803551
The ID of the compute requirement used to provision the compute resource.
2.316442
2
objects_API/WholeDNAJ.py
diogo1790team/inphinity_DM
0
6630654
from marshmallow import Schema, fields, post_load from rest_client.WholeDNARest import WholeDNAAPI class WholeDNASchema(Schema): """ This class map the json into the object WholeDNA ..note:: see marshmallow API """ id = fields.Int() id_db_online = fields.Str() sequence_DNA = fields.Str() ...
from marshmallow import Schema, fields, post_load from rest_client.WholeDNARest import WholeDNAAPI class WholeDNASchema(Schema): """ This class map the json into the object WholeDNA ..note:: see marshmallow API """ id = fields.Int() id_db_online = fields.Str() sequence_DNA = fields.Str() ...
en
0.712119
This class map the json into the object WholeDNA ..note:: see marshmallow API This class manage the object and is used to map them into json format Initialization of the class :param id: name of the function :param id_db_online: id of the database where the dna comes :param sequence_DNA: D...
3.096987
3
lookup.py
lambaradan/PyWORDS
11
6630655
# Main methods for looking up words from the dictionary import PYWORDS.definitions as definitions from PYWORDS.matchfilter import MatchFilter import re import os import bisect dictline = [] stems1 = [] stems2 = [] stems3 = [] stems4 = [] def load_dictionary(): f = open(os.path.join(os.path.dirname(os.path.abspat...
# Main methods for looking up words from the dictionary import PYWORDS.definitions as definitions from PYWORDS.matchfilter import MatchFilter import re import os import bisect dictline = [] stems1 = [] stems2 = [] stems3 = [] stems4 = [] def load_dictionary(): f = open(os.path.join(os.path.dirname(os.path.abspat...
en
0.810259
# Main methods for looking up words from the dictionary # Get sorted stems with original indices # enumerate provides iterable with (idx,element) tuples # sorted key uses element (e[1]) as sort parameter # sorted returns a list of tuples (idx,element), and then all tuples are flipped # to give (element,idx) # Flip elem...
3.280006
3
sharpy/plans/require/required_minerals.py
MadManSC2/sharpy-sc2
1
6630656
<gh_stars>1-10 import sc2 from sharpy.plans.require.require_base import RequireBase class RequiredMinerals(RequireBase): """Require that a specific number of minerals are "in the bank".""" def __init__(self, mineral_requirement: int): assert mineral_requirement is not None and isinstance(mine...
import sc2 from sharpy.plans.require.require_base import RequireBase class RequiredMinerals(RequireBase): """Require that a specific number of minerals are "in the bank".""" def __init__(self, mineral_requirement: int): assert mineral_requirement is not None and isinstance(mineral_requirement...
en
0.847403
Require that a specific number of minerals are "in the bank".
2.997242
3
graph4nlp/pytorch/test/kg_completion/src/spodernet/examples/snli.py
stjordanis/graph4nlp
96
6630657
<gh_stars>10-100 '''This models is an example for training a classifier on SNLI''' from __future__ import print_function from os.path import join import nltk import numpy as np import os import urllib import zipfile import sys from spodernet.hooks import AccuracyHook, LossHook, ETAHook from spodernet.preprocessing.pi...
'''This models is an example for training a classifier on SNLI''' from __future__ import print_function from os.path import join import nltk import numpy as np import os import urllib import zipfile import sys from spodernet.hooks import AccuracyHook, LossHook, ETAHook from spodernet.preprocessing.pipeline import Pip...
en
0.533307
This models is an example for training a classifier on SNLI Creates data and snli paths and downloads SNLI in the home dir Preprocesses SNLI data and returns to spoder files # load data #names, file_paths = snli2json() #train_path, dev_path, test_path = file_paths # tokenize and convert to hdf5 # 1. Setup pipeline to s...
2.347835
2
SecretColors/cmaps/parent.py
ri0t/SecretColors
0
6630658
<gh_stars>0 # Copyright (c) SecretBiology 2020. # # Library Name: SecretColors # Author: <NAME> # Website: https://github.com/secretBiology/SecretColors # # import random from SecretColors.data.constants import DIV_COLOR_PAIRS from SecretColors.helpers.logging import Log from SecretColors.models.palette import P...
# Copyright (c) SecretBiology 2020. # # Library Name: SecretColors # Author: <NAME> # Website: https://github.com/secretBiology/SecretColors # # import random from SecretColors.data.constants import DIV_COLOR_PAIRS from SecretColors.helpers.logging import Log from SecretColors.models.palette import Palette from ...
en
0.628927
# Copyright (c) SecretBiology 2020. # # Library Name: SecretColors # Author: <NAME> # Website: https://github.com/secretBiology/SecretColors # # This is parent class which will be inherited by all ColorMap objects. It includes all basic methods which will be common to all the ColorMaps. .. danger:: ...
2.876531
3
Problems/lcof-004/solve.py
luanshiyinyang/LCNotes
3
6630659
<gh_stars>1-10 class Solution: def findNumberIn2DArray(self, matrix: List[List[int]], target: int) -> bool: if matrix == []: return False row, column = len(matrix), len(matrix[0]) i, j = row - 1, 0 while i >=0 and j < column: if matrix[i][j] > target: ...
class Solution: def findNumberIn2DArray(self, matrix: List[List[int]], target: int) -> bool: if matrix == []: return False row, column = len(matrix), len(matrix[0]) i, j = row - 1, 0 while i >=0 and j < column: if matrix[i][j] > target: i -= 1 ...
none
1
3.398166
3
src/imitation/scripts/config/eval_policy.py
Cladett/imitation
1
6630660
import os import sacred from imitation.util import util eval_policy_ex = sacred.Experiment("eval_policy") @eval_policy_ex.config def replay_defaults(): env_name = "CartPole-v1" # environment to evaluate in eval_n_timesteps = int(1e4) # Min timesteps to evaluate, optional. eval_n_episodes = None # Nu...
import os import sacred from imitation.util import util eval_policy_ex = sacred.Experiment("eval_policy") @eval_policy_ex.config def replay_defaults(): env_name = "CartPole-v1" # environment to evaluate in eval_n_timesteps = int(1e4) # Min timesteps to evaluate, optional. eval_n_episodes = None # Nu...
en
0.738775
# environment to evaluate in # Min timesteps to evaluate, optional. # Num episodes to evaluate, optional. # number of environments in parallel # Use SubprocVecEnv (generally faster if num_vec>1) # Set to positive int to limit episode horizons # save video files # arguments to VideoWrapper # render to screen # -1 to ren...
2.227084
2
utils/functions.py
NIRDERIi/bot
2
6630661
<gh_stars>1-10 from utils.errors import ProcessError import discord from discord.ext import commands from utils.buttons import Paginator from bot import CustomContext, Bot import more_itertools import re import difflib import traceback from utils.constants import Time, General import datetime import contextlib MYSTB_D...
from utils.errors import ProcessError import discord from discord.ext import commands from utils.buttons import Paginator from bot import CustomContext, Bot import more_itertools import re import difflib import traceback from utils.constants import Time, General import datetime import contextlib MYSTB_DOCUMENTS = "htt...
en
0.427471
# So it won't print the error, optional INSERT INTO bugs (guild_id, user_id, short_error, full_traceback, error_time) VALUES($1, $2, $3, $4, $5) RETURNING bug_id
2.347189
2
data/connections.py
Poweedlou/Feather
4
6630662
<reponame>Poweedlou/Feather # DB connection import sqlalchemy as sa import sqlalchemy.orm as orm from sqlalchemy.orm import Session import sqlalchemy.ext.declarative as dec Base = dec.declarative_base() __factory = None def global_init(db_file): global __factory if __factory: return if not db_...
# DB connection import sqlalchemy as sa import sqlalchemy.orm as orm from sqlalchemy.orm import Session import sqlalchemy.ext.declarative as dec Base = dec.declarative_base() __factory = None def global_init(db_file): global __factory if __factory: return if not db_file or not db_file.strip():...
en
0.864273
# DB connection
2.765667
3
tests/unittests/test_keyboard.py
epth/ahk
1
6630663
import sys import os project_root = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../..')) sys.path.insert(0, project_root) from ahk import AHK from unittest import TestCase from itertools import product import time, subprocess from ahk.keys import KEYS, ALT, CTRL import threading class Test...
import sys import os project_root = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../..')) sys.path.insert(0, project_root) from ahk import AHK from unittest import TestCase from itertools import product import time, subprocess from ahk.keys import KEYS, ALT, CTRL import threading class Test...
en
0.429365
Record all open windows :return:
2.355768
2
bmds_server/common/management/commands/load_test_db.py
shapiromatron/bmds-server
1
6630664
from django.conf import settings from django.contrib.auth import get_user_model from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): help = """Load the test database from a fixture.""" def add_arguments(self, parser): ...
from django.conf import settings from django.contrib.auth import get_user_model from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): help = """Load the test database from a fixture.""" def add_arguments(self, parser): ...
en
0.781411
Load the test database from a fixture.
2.153766
2
tests/components/utility_meter/test_config_flow.py
mtarjoianu/core
30,023
6630665
"""Test the Utility Meter config flow.""" from unittest.mock import patch import pytest from homeassistant import config_entries from homeassistant.components.utility_meter.const import DOMAIN from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import RESULT_TYPE_CREATE_ENTRY, RESULT_TYPE_...
"""Test the Utility Meter config flow.""" from unittest.mock import patch import pytest from homeassistant import config_entries from homeassistant.components.utility_meter.const import DOMAIN from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import RESULT_TYPE_CREATE_ENTRY, RESULT_TYPE_...
en
0.715094
Test the Utility Meter config flow. Test the config flow. Test tariffs. Get suggested value for key in voluptuous schema. # Wanted key absent from schema Test reconfiguring. # Setup the config entry # Check config entry is reloaded with new options
2.382162
2
aws_config_policies/aws_config_all_resource_types.py
panther-labs/panther-cli
4
6630666
from panther_base_helpers import deep_get def policy(resource): return bool(deep_get(resource, "RecordingGroup", "AllSupported"))
from panther_base_helpers import deep_get def policy(resource): return bool(deep_get(resource, "RecordingGroup", "AllSupported"))
none
1
1.6266
2
model/MTGAT.py
wyu-du/MultiTurnDialogZoo
145
6630667
<filename>model/MTGAT.py #!/usr/bin/python3 # Author: GMFTBY # Time: 2019.9.29 ''' When to talk, control the talk timing ''' import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init from torch_geometric.nn import GCNConv, GATConv, TopKPooling from torch_geometric.data import Da...
<filename>model/MTGAT.py #!/usr/bin/python3 # Author: GMFTBY # Time: 2019.9.29 ''' When to talk, control the talk timing ''' import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init from torch_geometric.nn import GCNConv, GATConv, TopKPooling from torch_geometric.data import Da...
en
0.581219
#!/usr/bin/python3 # Author: GMFTBY # Time: 2019.9.29 When to talk, control the talk timing # create the graph batch dynamically Bidirectional GRU # self.hidden_proj = nn.Linear(n_layer * 2 * self.hidden_size, hidden_size) # self.bn = nn.BatchNorm1d(num_features=hidden_size) # hidden = hidden.permute(1, 0, 2) # hidden ...
2.269266
2
modules/util/reporter_service.py
KTH/aspen
0
6630668
__author__ = '<EMAIL>' import logging import traceback from modules.util import environment, exceptions, data_defs, error_cache from modules.util import redis, requests, pipeline_data_utils def handle_recommendation(pipeline_data, application_name, recommendation_text): logger = logging.getLogger(__name__) re...
__author__ = '<EMAIL>' import logging import traceback from modules.util import environment, exceptions, data_defs, error_cache from modules.util import redis, requests, pipeline_data_utils def handle_recommendation(pipeline_data, application_name, recommendation_text): logger = logging.getLogger(__name__) re...
en
0.842517
# This error has already been reported # We are re-reporting an error, make sure someone sees it # Only use backticks for error message if the message itself doesn't already # have any in it #error_str = f'```{error_str}```' # labels = {'label1':'value1','value2',...}
1.949617
2
backend/czi_hosted/data_common/matrix_loader.py
danmedani/cellxgene
1
6630669
<reponame>danmedani/cellxgene<filename>backend/czi_hosted/data_common/matrix_loader.py from enum import Enum import threading import time from backend.common.utils.data_locator import DataLocator from backend.common.errors import DatasetAccessError from contextlib import contextmanager from http import HTTPStatus fro...
from enum import Enum import threading import time from backend.common.utils.data_locator import DataLocator from backend.common.errors import DatasetAccessError from contextlib import contextmanager from http import HTTPStatus from backend.czi_hosted.data_common.rwlock import RWLock class MatrixDataCacheItem(objec...
en
0.888017
This class provides access and caching for a dataset. The first time a dataset is accessed, it is opened and cached. Later accesses use the cached version. It may also be deleted by the MatrixDataCacheManager to make room for another dataset. While a dataset is actively being used (during the lifetime ...
2.416244
2
bcs-ui/backend/tests/components/test_permissions.py
laodiu/bk-bcs
599
6630670
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
en
0.863828
# -*- coding: utf-8 -*- Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compli...
1.940662
2
kms.py
alvarodelvalle/devops-scripts
0
6630671
import csv import re from botocore.exceptions import ClientError import boto def get_keys_from_file(file): """ Reads a file and creates a list of dictionaries. :param file: Filename relative to project root. :return: lkeys - a list of dictionaries [{ Key: '00484545-2000-4111-900...
import csv import re from botocore.exceptions import ClientError import boto def get_keys_from_file(file): """ Reads a file and creates a list of dictionaries. :param file: Filename relative to project root. :return: lkeys - a list of dictionaries [{ Key: '00484545-2000-4111-900...
en
0.613134
Reads a file and creates a list of dictionaries. :param file: Filename relative to project root. :return: lkeys - a list of dictionaries [{ Key: '00484545-2000-4111-9000-611111111111', Region: 'us-east-1' }, { Key: '00484545-2000-4111-9000-622222222222...
3.029784
3
cvxpy/reductions/solvers/constant_solver.py
rpradal/cvxpy
0
6630672
<reponame>rpradal/cvxpy<gh_stars>0 from cvxpy.reductions.solution import Solution from cvxpy.reductions.solvers.solver import Solver import cvxpy.settings as s class ConstantSolver(Solver): """TODO(akshayka): Documentation.""" # Solver capabilities MIP_CAPABLE = True def accepts(self, problem) -> bo...
from cvxpy.reductions.solution import Solution from cvxpy.reductions.solvers.solver import Solver import cvxpy.settings as s class ConstantSolver(Solver): """TODO(akshayka): Documentation.""" # Solver capabilities MIP_CAPABLE = True def accepts(self, problem) -> bool: return len(problem.vari...
en
0.581284
TODO(akshayka): Documentation. # Solver capabilities
2.406295
2
oppgavesett_1/1_2/python/main.py
Secretmud/School_work
0
6630673
from math import pi print("Enter the radius of the circle") radius = float(input()) area = 2*pi*radius print("Radius", area)
from math import pi print("Enter the radius of the circle") radius = float(input()) area = 2*pi*radius print("Radius", area)
none
1
4.274862
4
whoville/cloudbreak/apis/v1recipes_api.py
mikchaos/whoville
0
6630674
<gh_stars>0 # coding: utf-8 """ Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. Sequen...
# coding: utf-8 """ Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud...
en
0.758339
# coding: utf-8 Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloudbreak is ...
1.569552
2
sysDump.py
fallen-geko/System-Info-Dump
0
6630675
<gh_stars>0 # Written by <NAME> # References: got some help from: # - https://www.thepythoncode.com/article/get-hardware-system-information-python # - https://www.programcreek.com/python/example/53873/psutil.boot_time # - https://docs.python.org/3/library/time.html import psutil import platform import cs...
# Written by <NAME> # References: got some help from: # - https://www.thepythoncode.com/article/get-hardware-system-information-python # - https://www.programcreek.com/python/example/53873/psutil.boot_time # - https://docs.python.org/3/library/time.html import psutil import platform import csv import os...
en
0.724501
# Written by <NAME> # References: got some help from: # - https://www.thepythoncode.com/article/get-hardware-system-information-python # - https://www.programcreek.com/python/example/53873/psutil.boot_time # - https://docs.python.org/3/library/time.html #Partitions # Partition cant be accessed # IO stats since bo...
2.490442
2
tests/test_main.py
K0lb3/binaryreader
1
6630676
from struct import unpack_from, Struct, unpack, pack from binaryreader import BinaryReader TESTS = [ ("Bool", "?", 1), ("Int8", "b", -8), ("UInt8", "B", 8), ("Int16", "h", -16), ("UInt16", "H", 16), ("Int32", "i", -32), ("UInt32", "I", 32), ("Int64", "q", -64), ("UInt64", "Q", 64), ...
from struct import unpack_from, Struct, unpack, pack from binaryreader import BinaryReader TESTS = [ ("Bool", "?", 1), ("Int8", "b", -8), ("UInt8", "B", 8), ("Int16", "h", -16), ("UInt16", "H", 16), ("Int32", "i", -32), ("UInt32", "I", 32), ("Int64", "q", -64), ("UInt64", "Q", 64), ...
en
0.409385
# generate the tests def test_{name}(): print("Test {name}") for endian in ["<", ">"]: data = Struct(endian + "{fmt}").pack({value}) br = BinaryReader(data, endian == "<") br_value = br.read{name}() print({value}, br_value) assert(br_value == {value}) return br def te...
2.961644
3
corehq/form_processor/serializers.py
dborowiecki/commcare-hq
0
6630677
<gh_stars>0 from django.utils.functional import lazy from jsonfield import JSONField from rest_framework import serializers from corehq.apps.commtrack.models import StockState from corehq.blobs.models import BlobMeta from corehq.form_processor.models import ( CommCareCaseIndexSQL, CommCareCaseSQL, CaseTransaction,...
from django.utils.functional import lazy from jsonfield import JSONField from rest_framework import serializers from corehq.apps.commtrack.models import StockState from corehq.blobs.models import BlobMeta from corehq.form_processor.models import ( CommCareCaseIndexSQL, CommCareCaseSQL, CaseTransaction, XFormIn...
en
0.893353
A ModelSerializer that takes an additional `fields` argument that controls which fields should be displayed. This serializer is for presenting a case in json for APIs to access
2.107344
2
programas/ola_mundo.py
ismaeldamiao/Apostila_de_IFC
0
6630678
<filename>programas/ola_mundo.py<gh_stars>0 print("<NAME>")
<filename>programas/ola_mundo.py<gh_stars>0 print("<NAME>")
none
1
1.108982
1
CodingTest_Study1/week09/ex2740.py
FridayAlgorithm/taesong_study
0
6630679
# BOJ 행렬 곱셈 2740 N, M = map(int, input().split()) # 행렬 A의 크기 N, M A = [] for i in range(N): A.append(list(map(int, input().split()))) M, K = map(int, input().split()) # 행렬 B의 크기 M. K B = [] for i in range(M): B.append(list(map(int, input().split()))) C = [[0] * K for _ in range(N)] for i in range(N): f...
# BOJ 행렬 곱셈 2740 N, M = map(int, input().split()) # 행렬 A의 크기 N, M A = [] for i in range(N): A.append(list(map(int, input().split()))) M, K = map(int, input().split()) # 행렬 B의 크기 M. K B = [] for i in range(M): B.append(list(map(int, input().split()))) C = [[0] * K for _ in range(N)] for i in range(N): f...
ko
0.997607
# BOJ 행렬 곱셈 2740 # 행렬 A의 크기 N, M # 행렬 B의 크기 M. K
2.936219
3
payment_ui/custom_extensions/jinja_markdown_filter/main.py
LandRegistry/digital-street-payment-ui
1
6630680
import misaka from jinja2 import Markup from payment_ui.custom_extensions.jinja_markdown_filter.gov_renderer import GovRenderer class JinjaMarkdownFilter(object): """Markdown filter for Jinja templates""" render_markdown = misaka.Markdown(GovRenderer(), extensions=('autolink',)) def __init__(self, app=No...
import misaka from jinja2 import Markup from payment_ui.custom_extensions.jinja_markdown_filter.gov_renderer import GovRenderer class JinjaMarkdownFilter(object): """Markdown filter for Jinja templates""" render_markdown = misaka.Markdown(GovRenderer(), extensions=('autolink',)) def __init__(self, app=No...
en
0.413395
Markdown filter for Jinja templates
2.31875
2
economic/journals.py
reiem/python-economic-rest
0
6630681
<reponame>reiem/python-economic-rest<filename>economic/journals.py<gh_stars>0 from economic.journal_entries import JournalEntry from economic.query import QueryMixin from economic.serializer import EconomicSerializer class JournalSerializer(EconomicSerializer): id_property_name = 'journal_number' class Journal(...
from economic.journal_entries import JournalEntry from economic.query import QueryMixin from economic.serializer import EconomicSerializer class JournalSerializer(EconomicSerializer): id_property_name = 'journal_number' class Journal(JournalSerializer, QueryMixin): base_url = "https://restapi.e-conomic.com/...
en
0.913027
# self.entries is the URL for this Journals's entries # we have to remove the query parameters from the URL first, since they are added again by _query
2.399312
2
reverses/deoat.py
CortanaOS/tools
0
6630682
<gh_stars>0 #!/usr/bin/python # Copyright 2015 Coron # # 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...
#!/usr/bin/python # Copyright 2015 Coron # # 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 ...
en
0.809192
#!/usr/bin/python # Copyright 2015 Coron # # 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 w...
2.037552
2
defects_dlmbl/utilities.py
bbarad/defects_DLMBL
0
6630683
<gh_stars>0 import mrcfile import zarr import numpy as np def mrc_to_zarr(input_mrc_list, output_zarr, input_label_list=None, labels_upside_down = True, flipy=None): """ Convert a group of mrc files (data and labels) to a zarr file. Assume file names are of the form: '<identifier>_<datatype>.mrc' i...
import mrcfile import zarr import numpy as np def mrc_to_zarr(input_mrc_list, output_zarr, input_label_list=None, labels_upside_down = True, flipy=None): """ Convert a group of mrc files (data and labels) to a zarr file. Assume file names are of the form: '<identifier>_<datatype>.mrc' input_mrc_lis...
en
0.557534
Convert a group of mrc files (data and labels) to a zarr file. Assume file names are of the form: '<identifier>_<datatype>.mrc' input_mrc_list - list (or singular string) of mrc files to convert input_label_list - list (or singular string) of mrc files to convert. Labels can be for a subset of data files.
3.091756
3
tests/ut/cpp/python_input/gtest_input/pre_activate/remove_internal_output_test.py
chncwang/mindspore
0
6630684
<reponame>chncwang/mindspore # Copyright 2020 Huawei Technologies Co., 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-2.0 # # Unless required b...
# Copyright 2020 Huawei Technologies Co., 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-2.0 # # Unless required by applicable law or agreed to...
en
0.808111
# Copyright 2020 Huawei Technologies Co., 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-2.0 # # Unless required by applicable law or agreed to...
2.177313
2
migrations/versions/69a322b64d30_add_scraper_table.py
pm5/ArticleParser
1
6630685
<gh_stars>1-10 """add scraper table Revision ID: <KEY> Revises: <PASSWORD> Create Date: 2020-03-27 09:52:22.509131 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "<KEY>" down_revision = "afdac32d3727" branch_labels = None depends_on = None def upgrade(): ...
"""add scraper table Revision ID: <KEY> Revises: <PASSWORD> Create Date: 2020-03-27 09:52:22.509131 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "<KEY>" down_revision = "afdac32d3727" branch_labels = None depends_on = None def upgrade(): op.create_tabl...
en
0.396528
add scraper table Revision ID: <KEY> Revises: <PASSWORD> Create Date: 2020-03-27 09:52:22.509131 # revision identifiers, used by Alembic.
1.836747
2
test/test_helper_classes.py
mikisama/python-can-isotp
0
6630686
<gh_stars>0 import unittest import isotp import time from . import unittest_logging from isotp.protocol import RateLimiter Message = isotp.CanMessage # Make sure that our Timer class used for timeouts is working OK class testTimer(unittest.TestCase): def test_timer(self): timeout = 0.2 ...
import unittest import isotp import time from . import unittest_logging from isotp.protocol import RateLimiter Message = isotp.CanMessage # Make sure that our Timer class used for timeouts is working OK class testTimer(unittest.TestCase): def test_timer(self): timeout = 0.2 t = isotp.T...
en
0.79699
# Make sure that our Timer class used for timeouts is working OK # Here we check that we decode properly ecah type of frame # Empty data # Single Frame, imcomplete escape sequence # Missing 1 byte of data for single frame without escape sequence # With prefix # Valid single frames without escape sequence # With prefix ...
2.619311
3
Code/multilabelloss.py
Szhgege/DACPGTN
0
6630687
import torch def multilabel_categorical_crossentropy(y_true, y_pred): y_pred = (1 - 2 * y_true) * y_pred y_pred_neg = y_pred - y_true * 1e12 y_pred_pos = y_pred - (1 - y_true) * 1e12 zeros = torch.zeros_like(y_pred[..., :1]) y_pred_neg = torch.cat([y_pred_neg, zeros], dim=-1) y_pred_pos =...
import torch def multilabel_categorical_crossentropy(y_true, y_pred): y_pred = (1 - 2 * y_true) * y_pred y_pred_neg = y_pred - y_true * 1e12 y_pred_pos = y_pred - (1 - y_true) * 1e12 zeros = torch.zeros_like(y_pred[..., :1]) y_pred_neg = torch.cat([y_pred_neg, zeros], dim=-1) y_pred_pos =...
en
0.694652
# Retrieved from https://github.com/bojone/bert4keras. For more detailed instructions please visit the https://spaces.ac.cn/archives/7359.
2.580602
3
codewof/programming/content/en/print-bigger-number/solution.py
uccser-admin/programming-practice-prototype
3
6630688
def print_bigger_number(first, second): if int(first) > int(second): print(first) else: print(second)
def print_bigger_number(first, second): if int(first) > int(second): print(first) else: print(second)
none
1
3.461053
3
feature_examples/tensorflow2/embeddings/imdb_single_ipu.py
MMKrell/gc_tutorials
0
6630689
<filename>feature_examples/tensorflow2/embeddings/imdb_single_ipu.py # Copyright (c) 2020 Graphcore Ltd. All rights reserved. import tensorflow as tf from tensorflow.python import ipu from ipu_tensorflow_addons.keras.layers import Embedding, LSTM from tensorflow.keras.layers import Dense from tensorflow.keras.layers ...
<filename>feature_examples/tensorflow2/embeddings/imdb_single_ipu.py # Copyright (c) 2020 Graphcore Ltd. All rights reserved. import tensorflow as tf from tensorflow.python import ipu from ipu_tensorflow_addons.keras.layers import Embedding, LSTM from tensorflow.keras.layers import Dense from tensorflow.keras.layers ...
en
0.665743
# Copyright (c) 2020 Graphcore Ltd. All rights reserved. # Define the dataset. # Define the model. # Configure IPUs. # Set up IPU strategy.
2.603758
3
pymatgen/io/tests/test_feffio_set.py
rousseab/pymatgen
1
6630690
<gh_stars>1-10 # coding: utf-8 from __future__ import unicode_literals import unittest import os from pymatgen.io.feff.sets import FeffInputSet from pymatgen.io.feff import FeffPot from pymatgen.io.cif import CifParser test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..", 'tes...
# coding: utf-8 from __future__ import unicode_literals import unittest import os from pymatgen.io.feff.sets import FeffInputSet from pymatgen.io.feff import FeffPot from pymatgen.io.cif import CifParser test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..", 'test_files') cif_f...
en
0.244808
# coding: utf-8 * This FEFF.inp file generated by pymatgen TITLE comment: From cif file TITLE Source: CoO19128.cif TITLE Structure Summary: Co2 O2 TITLE Reduced formula: CoO TITLE space group: (P6_3mc), space number: (186) TITLE abc: 3.297078 3.297078 5.254213 TITLE angles: 90.000000 90.000000 120.000000 TITL...
2.362792
2
setup.py
vinhluan/oracle-json-field
2
6630691
from distutils.core import Command from setuptools import setup class TestCommand(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): from django.conf import settings import os oracle_json_host = os....
from distutils.core import Command from setuptools import setup class TestCommand(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): from django.conf import settings import os oracle_json_host = os....
none
1
1.908816
2
experiments/gan/munit/train_layout_by_pixels.py
w121211/CoordConv
0
6630692
# %%writefile /content/CoordConv/experiments/gan/munit/train_layout.py import argparse import os import numpy as np import math import sys import torchvision.transforms as transforms from torchvision.utils import save_image import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data impor...
# %%writefile /content/CoordConv/experiments/gan/munit/train_layout.py import argparse import os import numpy as np import math import sys import torchvision.transforms as transforms from torchvision.utils import save_image import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data impor...
en
0.449915
# %%writefile /content/CoordConv/experiments/gan/munit/train_layout.py # ------------------------------- # Define models # ------------------------------- # normalize again after relu6 (multiply by 6.) # normalize again after relu6 (multiply by 6.) # align to y-axis # *block(in_dim, 128, normalize=False), # print(coord...
2.093113
2
wavenet_vocoder/builder.py
entn-at/clari_wavenet_vocoder
54
6630693
# coding: utf-8 from __future__ import with_statement, print_function, absolute_import def wavenet(out_channels=256, layers=20, stacks=2, residual_channels=512, gate_channels=512, skip_out_channels=512, cin_channels=-1, gin_channels=-...
# coding: utf-8 from __future__ import with_statement, print_function, absolute_import def wavenet(out_channels=256, layers=20, stacks=2, residual_channels=512, gate_channels=512, skip_out_channels=512, cin_channels=-1, gin_channels=-...
en
0.833554
# coding: utf-8
2.345563
2
dataloaders/__init__.py
XuPenglei/DSRL-old
0
6630694
from dataloaders.datasets import cityscapes, coco, combine_dbs, pascal, sbd, SimulateDataset from torch.utils.data import DataLoader def make_data_loader(args, **kwargs): if args.dataset == 'pascal': train_set = pascal.VOCSegmentation(args, split='train') val_set = pascal.VOCSegmentation(args, spl...
from dataloaders.datasets import cityscapes, coco, combine_dbs, pascal, sbd, SimulateDataset from torch.utils.data import DataLoader def make_data_loader(args, **kwargs): if args.dataset == 'pascal': train_set = pascal.VOCSegmentation(args, split='train') val_set = pascal.VOCSegmentation(args, spl...
el
0.098435
# X_dir=r'F:\Data\Dream-B\train\image', # Xlr_dir=r'F:\Data\Dream-B\train\imageLR', # Y_dir=r'F:\Data\Dream-B\train\label', # X_dir=r'F:\Data\Dream-B\train\image', # Xlr_dir=r'F:\Data\Dream-B\train\imageLR', # Y_dir=r'F:\Data\Dream-B\train\label',
2.556337
3
models/model_util.py
jaswanthbjk/3D-Object-Detection
0
6630695
import numpy as np import tensorflow as tf import os import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) import tf_util # ----------------- # Global Constants # ----------------- NUM_HEADING_BIN = 12 NUM_SIZE_CLUSTER = 8 # one cluster for each type NUM_OBJECT_PO...
import numpy as np import tensorflow as tf import os import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) import tf_util # ----------------- # Global Constants # ----------------- NUM_HEADING_BIN = 12 NUM_SIZE_CLUSTER = 8 # one cluster for each type NUM_OBJECT_PO...
en
0.705043
# ----------------- # Global Constants # ----------------- # one cluster for each type # g_type2class = {'car': 0, 'Van': 1, 'Truck': 2, 'pedestrian': 3, # 'Person_sitting': 4, 'bicycle': 5, 'Tram': 6, 'Misc': 7} # g_class2type = {g_type2class[t]: t for t in g_type2class} # g_type2onehotclass = {'car': ...
2.262232
2
test/test_sqlquery.py
KonstantinKlepikov/SimpleSQLite
1
6630696
# encoding: utf-8 """ .. codeauthor:: <NAME> <<EMAIL>> """ from __future__ import unicode_literals import pytest from simplesqlite.query import And, Or, Where from simplesqlite.sqlquery import SqlQuery nan = float("nan") inf = float("inf") class Test_SqlQuery_make_update(object): @pytest.mark.parametrize( ...
# encoding: utf-8 """ .. codeauthor:: <NAME> <<EMAIL>> """ from __future__ import unicode_literals import pytest from simplesqlite.query import And, Or, Where from simplesqlite.sqlquery import SqlQuery nan = float("nan") inf = float("inf") class Test_SqlQuery_make_update(object): @pytest.mark.parametrize( ...
en
0.277426
# encoding: utf-8 .. codeauthor:: <NAME> <<EMAIL>>
2.519339
3
ldaSegmentation/modules/reviewModules.py
Rahul-Khanna/reviews_research
0
6630697
<reponame>Rahul-Khanna/reviews_research<gh_stars>0 # Module file used for Review Segmentation # Author : <NAME> import re from gensim import corpora, models, similarities, matutils import json # The review object used by all scripts not in graphApproach class Review(): def __init__(self,id,review,realTags,sentences=N...
# Module file used for Review Segmentation # Author : <NAME> import re from gensim import corpora, models, similarities, matutils import json # The review object used by all scripts not in graphApproach class Review(): def __init__(self,id,review,realTags,sentences=None,features=None,predictedTags=None, predictedLDAS...
en
0.54443
# Module file used for Review Segmentation # Author : <NAME> # The review object used by all scripts not in graphApproach # MyCorpus object used for loading the LDA model # Written by <NAME> #self.reset(); #for line in self.read_file(): #print(self.proc(line)) #self.reset();
2.517117
3
pytpp/attributes/opentrust_pki_ca.py
Venafi/pytpp
4
6630698
<filename>pytpp/attributes/opentrust_pki_ca.py from pytpp.attributes._helper import IterableMeta, Attribute from pytpp.attributes.http_ca_base import HTTPCABaseAttributes class OpenTrustPKICAAttributes(HTTPCABaseAttributes, metaclass=IterableMeta): __config_class__ = "OpenTrust PKI CA" connector_type = Attribute('C...
<filename>pytpp/attributes/opentrust_pki_ca.py from pytpp.attributes._helper import IterableMeta, Attribute from pytpp.attributes.http_ca_base import HTTPCABaseAttributes class OpenTrustPKICAAttributes(HTTPCABaseAttributes, metaclass=IterableMeta): __config_class__ = "OpenTrust PKI CA" connector_type = Attribute('C...
none
1
2.109464
2
arcgis/utils_excel.py
hvostsobaki/arcgis
0
6630699
<gh_stars>0 import arcpy import openpyxl # Получение списка имен столбцов с возможностью сортировки по алфавиту def get_columns_list(file, sheet, sort=False): wb = openpyxl.load_workbook(file) tab = wb[sheet] columns_list = [ tab.cell(row=1, column=i).value for i in range(1, tab.max_column+1) ...
import arcpy import openpyxl # Получение списка имен столбцов с возможностью сортировки по алфавиту def get_columns_list(file, sheet, sort=False): wb = openpyxl.load_workbook(file) tab = wb[sheet] columns_list = [ tab.cell(row=1, column=i).value for i in range(1, tab.max_column+1) ] if...
ru
0.992529
# Получение списка имен столбцов с возможностью сортировки по алфавиту # Получение данных из заданного листа Excel # и создание из них словаря {id: {id: ..., field1: ...}}.
2.780643
3
media_organiser.py
arkalon76/Icecream
1
6630700
from pymediainfo import MediaInfo import sys, os, pymongo, hashlib, configparser, xxhash, locale, argparse, json, logging from guessit import guessit from imdbpie import Imdb imdb = Imdb(anonymize=True) # to proxy requests REBUILD_SIDECAR = False # Setting default hasher - can be changed with command line # Let's c...
from pymediainfo import MediaInfo import sys, os, pymongo, hashlib, configparser, xxhash, locale, argparse, json, logging from guessit import guessit from imdbpie import Imdb imdb = Imdb(anonymize=True) # to proxy requests REBUILD_SIDECAR = False # Setting default hasher - can be changed with command line # Let's c...
en
0.874636
# to proxy requests # Setting default hasher - can be changed with command line # Let's configure the locale # We use this for number formating while we count blocks # We couldn't find the keys we need. Let's rebuild it # Ok, so we got the key's, now let's make sure they are all valid values # attached to the key's Has...
2.380642
2
scripts/gen-docs.py
ThreeSixtyGiving/prototype-tools
0
6630701
<reponame>ThreeSixtyGiving/prototype-tools<filename>scripts/gen-docs.py # This script generates an intermediate representation of the data model ready for translation into CSV import json import operator # Used in sorting from sets import Set from genmodel import generateModel, getName # Change final parameter to Fals...
# This script generates an intermediate representation of the data model ready for translation into CSV import json import operator # Used in sorting from sets import Set from genmodel import generateModel, getName # Change final parameter to False / True depending on whether you want roll-ups or not. # Note to self: ...
en
0.458978
# This script generates an intermediate representation of the data model ready for translation into CSV # Used in sorting # Change final parameter to False / True depending on whether you want roll-ups or not. # Note to self: Use python gen-docs.py > ../website/standard/_includes/buildingblocks.html with rollups false ...
2.76027
3
Dart2/JsonHelper.py
mcskik/Python
0
6630702
import io import json import sys import Constants def printFormattedJson(json_container, sort=True, indents=Constants.indentSize): if type(json_container) is str: print(json.dumps(json.loads(json_container), sort_keys=sort, indent=indents)) else: print(json.dumps(json_container, sort_keys=sor...
import io import json import sys import Constants def printFormattedJson(json_container, sort=True, indents=Constants.indentSize): if type(json_container) is str: print(json.dumps(json.loads(json_container), sort_keys=sort, indent=indents)) else: print(json.dumps(json_container, sort_keys=sor...
en
0.614671
# Redirect sys.stdout to an in memory buffer. # Capture print output. # Restore original sys.stdout.
2.899127
3
sarif/operations/ls_op.py
microsoft/sarif-tools
8
6630703
<reponame>microsoft/sarif-tools """ Code for `sarif ls` command. """ from typing import List from sarif import loader def print_ls(files_or_dirs: List[str], output): """ Print a SARIF file listing for each of the input files or directories. """ dir_result = [] for path in files_or_dirs: ...
""" Code for `sarif ls` command. """ from typing import List from sarif import loader def print_ls(files_or_dirs: List[str], output): """ Print a SARIF file listing for each of the input files or directories. """ dir_result = [] for path in files_or_dirs: dir_result.append(f"{path}:") ...
en
0.74615
Code for `sarif ls` command. Print a SARIF file listing for each of the input files or directories.
3.83169
4
sky/engine/build/scripts/make_media_features.py
domenic/mojo
5,964
6630704
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import media_feature_symbol import in_generator import template_expander import name_utilities import sys class MakeMediaFeaturesWri...
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import media_feature_symbol import in_generator import template_expander import name_utilities import sys class MakeMediaFeaturesWri...
en
0.855495
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # FIXME: Add support for Conditional.
1.912353
2
config/score_game.py
rafiberlin/sose21-pm-language-and-vision-g1
0
6630705
import os from config.util import get_config, read_game_logs, output_game_metrics import argparse # Execute as score_game.py --file rafi_10_games_04_jun_21_attention_caption_lxmert_vqa.txt --dir ../data/game_logs if __name__ == "__main__": parser = argparse.ArgumentParser(description='Calculate the game statistics...
import os from config.util import get_config, read_game_logs, output_game_metrics import argparse # Execute as score_game.py --file rafi_10_games_04_jun_21_attention_caption_lxmert_vqa.txt --dir ../data/game_logs if __name__ == "__main__": parser = argparse.ArgumentParser(description='Calculate the game statistics...
en
0.483212
# Execute as score_game.py --file rafi_10_games_04_jun_21_attention_caption_lxmert_vqa.txt --dir ../data/game_logs
2.508628
3
moran_process.py
pikawika/VUB-CGT-assignment-1
0
6630706
#Name: <NAME> #StudentID: 568702 #Affiliation: VUB - Master Computer Science: AI import random import numpy as np from IPython.display import display def moran_step(current_state, beta, mu, Z, A): """ This function returns the next state of the population where * current_state, is the current stat...
#Name: <NAME> #StudentID: 568702 #Affiliation: VUB - Master Computer Science: AI import random import numpy as np from IPython.display import display def moran_step(current_state, beta, mu, Z, A): """ This function returns the next state of the population where * current_state, is the current stat...
en
0.881154
#Name: <NAME> #StudentID: 568702 #Affiliation: VUB - Master Computer Science: AI This function returns the next state of the population where * current_state, is the current state of the population * beta is the intensity of selection * mu is the mutation probability * Z is the population size * A i...
3.024446
3
app/models.py
richardpanda/todo-api
0
6630707
import jwt from app import db from bcrypt import checkpw, gensalt, hashpw from flask import current_app from sqlalchemy.orm import relationship class Todo(db.Model): id = db.Column(db.Integer, primary_key=True) text = db.Column(db.String(100)) is_completed = db.Column(db.Boolean, default=False) user_...
import jwt from app import db from bcrypt import checkpw, gensalt, hashpw from flask import current_app from sqlalchemy.orm import relationship class Todo(db.Model): id = db.Column(db.Integer, primary_key=True) text = db.Column(db.String(100)) is_completed = db.Column(db.Boolean, default=False) user_...
none
1
2.554485
3
Lib/site-packages/mock/tests/__init__.py
inging44/python3
16,989
6630708
# Copyright (C) 2007-2012 <NAME> & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/
# Copyright (C) 2007-2012 <NAME> & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/
en
0.605774
# Copyright (C) 2007-2012 <NAME> & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/
1.006905
1
modules/vcd_vapp_vm_disk.py
okassov/ansible-role-vmware-vcloud
0
6630709
<gh_stars>0 # Copyright © 2018 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: BSD-2-Clause OR GPL-3.0-only # !/usr/bin/python ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: vcd_vapp_vm_disk short_descripti...
# Copyright © 2018 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: BSD-2-Clause OR GPL-3.0-only # !/usr/bin/python ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: vcd_vapp_vm_disk short_description: Ansible ...
en
0.762501
# Copyright © 2018 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: BSD-2-Clause OR GPL-3.0-only # !/usr/bin/python --- module: vcd_vapp_vm_disk short_description: Ansible Module to manage disks in vApp VMs in vCloud Director. version_added: "2.4" description: - "Ansible Module to manage (create/update/...
1.733947
2
jieba/analyse/analyzer.py
Jaybeka/jieba
1
6630710
<reponame>Jaybeka/jieba #encoding=utf-8 from whoosh.analysis import RegexAnalyzer,LowercaseFilter,StopFilter,StemFilter from whoosh.analysis import Tokenizer,Token from whoosh.lang.porter import stem import jieba import re STOP_WORDS = frozenset(('a', 'an', 'and', 'are', 'as', 'at', 'be', 'by', 'can', ...
#encoding=utf-8 from whoosh.analysis import RegexAnalyzer,LowercaseFilter,StopFilter,StemFilter from whoosh.analysis import Tokenizer,Token from whoosh.lang.porter import stem import jieba import re STOP_WORDS = frozenset(('a', 'an', 'and', 'are', 'as', 'at', 'be', 'by', 'can', 'for', 'from',...
en
0.595601
#encoding=utf-8
2.477079
2
171/__init__.py
sc4599/LeetCode
0
6630711
__author__ = 'songchao'
__author__ = 'songchao'
none
1
0.907934
1
pyscf/cc/__init__.py
nmardirossian/pyscf
1
6630712
<filename>pyscf/cc/__init__.py ''' Coupled Cluster =============== Simple usage:: >>> from pyscf import gto, scf, cc >>> mol = gto.M(atom='H 0 0 0; H 0 0 1') >>> mf = scf.RHF(mol).run() >>> cc.CCSD(mf).run() :func:`cc.CCSD` returns an instance of CCSD class. Followings are parameters to control CCSD...
<filename>pyscf/cc/__init__.py ''' Coupled Cluster =============== Simple usage:: >>> from pyscf import gto, scf, cc >>> mol = gto.M(atom='H 0 0 0; H 0 0 1') >>> mf = scf.RHF(mol).run() >>> cc.CCSD(mf).run() :func:`cc.CCSD` returns an instance of CCSD class. Followings are parameters to control CCSD...
en
0.591835
Coupled Cluster =============== Simple usage:: >>> from pyscf import gto, scf, cc >>> mol = gto.M(atom='H 0 0 0; H 0 0 1') >>> mf = scf.RHF(mol).run() >>> cc.CCSD(mf).run() :func:`cc.CCSD` returns an instance of CCSD class. Followings are parameters to control CCSD calculation. verbose : int ...
2.471021
2
Connect to LAN GUIautomate.py
RAVURISREESAIHARIKRISHNA/Python-2.7.12-3.5.2-
0
6630713
<gh_stars>0 import pyautogui,time pyautogui.typewrite(["win"]) time.sleep(0.25) pyautogui.click(1173,735) time.sleep(1) pyautogui.click(1187,502) time.sleep(1) #pyautogui.keyDown("win") #pyautogui.typewrite("up") #pyautogui.keyUp("win") #time.sleep(0) pyautogui.click(464,151) time.sleep(0.2) pyautogui.move...
import pyautogui,time pyautogui.typewrite(["win"]) time.sleep(0.25) pyautogui.click(1173,735) time.sleep(1) pyautogui.click(1187,502) time.sleep(1) #pyautogui.keyDown("win") #pyautogui.typewrite("up") #pyautogui.keyUp("win") #time.sleep(0) pyautogui.click(464,151) time.sleep(0.2) pyautogui.moveTo(476,199)
en
0.174228
#pyautogui.keyDown("win") #pyautogui.typewrite("up") #pyautogui.keyUp("win") #time.sleep(0)
2.435736
2
gvm-insert.py
gubertoli/practicalvm
12
6630714
<reponame>gubertoli/practicalvm #!/usr/bin/env python3 # Iterate through an openvas output XML file # and insert relevant information into a Mongo database # OID is considered the authoritative identifiers of individual # vulnerabilities, and if a vulnerability or host-vuln mapping # already exists in Mongo, data prov...
#!/usr/bin/env python3 # Iterate through an openvas output XML file # and insert relevant information into a Mongo database # OID is considered the authoritative identifiers of individual # vulnerabilities, and if a vulnerability or host-vuln mapping # already exists in Mongo, data provided here will # be ignored. # #...
en
0.887051
#!/usr/bin/env python3 # Iterate through an openvas output XML file # and insert relevant information into a Mongo database # OID is considered the authoritative identifiers of individual # vulnerabilities, and if a vulnerability or host-vuln mapping # already exists in Mongo, data provided here will # be ignored. # # ...
2.762698
3
Unmaintained/PythonScraping/allarticles_pool.py
IQSS/workshops
30
6630715
from lxml import etree from multiprocessing import Pool import shutil import csv import urllib import re def scrapeSingle(num): f = open('/tmp/parsed'+str(num)+'.csv','w') entries = ["Day","Month","Year","Title","Remote","Local"] c = csv.DictWriter(f,entries) baseurl = "http://www.egyptindependent.com/subc...
from lxml import etree from multiprocessing import Pool import shutil import csv import urllib import re def scrapeSingle(num): f = open('/tmp/parsed'+str(num)+'.csv','w') entries = ["Day","Month","Year","Title","Remote","Local"] c = csv.DictWriter(f,entries) baseurl = "http://www.egyptindependent.com/subc...
en
0.834889
# start 40 worker processes
2.803636
3
pyroms_toolbox/pyroms_toolbox/BGrid_SODA/BGrid_SODA.py
bilgetutak/pyroms
75
6630716
<gh_stars>10-100 import numpy as np from mpl_toolkits.basemap import pyproj from datetime import datetime try: import netCDF4 as netCDF except: import netCDF3 as netCDF import pyroms class BGrid_SODA(object): """ BGrid object for SODA """ def __init__(self, lon_t, lat_t, lon_uv, lat_uv, mask_t, ma...
import numpy as np from mpl_toolkits.basemap import pyproj from datetime import datetime try: import netCDF4 as netCDF except: import netCDF3 as netCDF import pyroms class BGrid_SODA(object): """ BGrid object for SODA """ def __init__(self, lon_t, lat_t, lon_uv, lat_uv, mask_t, mask_uv, depth, dep...
en
0.703169
BGrid object for SODA
2.126463
2
hummingbot/strategy/volume_generation/start.py
MahaTrade/hummingbot
0
6630717
<reponame>MahaTrade/hummingbot from hummingbot.strategy.market_trading_pair_tuple import MarketTradingPairTuple from hummingbot.strategy.volume_generation import VolumeGeneration from hummingbot.strategy.volume_generation.volume_generation_config_map import volume_generation_config_map as c_map def start(self): c...
from hummingbot.strategy.market_trading_pair_tuple import MarketTradingPairTuple from hummingbot.strategy.volume_generation import VolumeGeneration from hummingbot.strategy.volume_generation.volume_generation_config_map import volume_generation_config_map as c_map def start(self): connector = c_map.get("connector...
en
0.154413
# price = c_map.get("price").value
2.321201
2
textvis/settings.py
scclab/textvisdrg-prototype
0
6630718
""" Django settings for textvis project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
""" Django settings for textvis project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
en
0.611948
Django settings for textvis project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Quick-sta...
1.851688
2
drivers/firmata-dbg.py
prozum/embug
0
6630719
from PyQt4 import QtCore dPins = range(14) aPins = range(18,24) A0,A1,A2,A3,A4,A5 = aPins HIGH,OUT = (1,1) LOW,IN = (0,0) class Driver(): def __init__(self,sim): self.sim = sim def pinMode(self,pin,mode): self.sim.emit(QtCore.SIGNAL("sPinMode"),pin,mode) def digitalRead(self,pin): ...
from PyQt4 import QtCore dPins = range(14) aPins = range(18,24) A0,A1,A2,A3,A4,A5 = aPins HIGH,OUT = (1,1) LOW,IN = (0,0) class Driver(): def __init__(self,sim): self.sim = sim def pinMode(self,pin,mode): self.sim.emit(QtCore.SIGNAL("sPinMode"),pin,mode) def digitalRead(self,pin): ...
none
1
2.788062
3
CryptoReturns/forms.py
wjone005/Crypto_Returns
0
6630720
<filename>CryptoReturns/forms.py from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, DecimalField, validators class Crypto_Form(FlaskForm): name = StringField("Enter Coin Name", [validators.InputRequired(message="Please enter the Crypto Currency name.")]) intial_investment = DecimalFi...
<filename>CryptoReturns/forms.py from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, DecimalField, validators class Crypto_Form(FlaskForm): name = StringField("Enter Coin Name", [validators.InputRequired(message="Please enter the Crypto Currency name.")]) intial_investment = DecimalFi...
none
1
2.951551
3
tests/links_tests/update_tests/test_megnet_update.py
pfnet/chainerchem
184
6630721
from chainer import cuda import numpy import pytest from chainer_chemistry.links.update.megnet_update import MEGNetUpdate # node_size_list means the first moleculae has six nodes, # and the seconde molecule has four nodes node_size_list = [6, 4] # edge_size_list means the first moleculae has eight edges, # and the s...
from chainer import cuda import numpy import pytest from chainer_chemistry.links.update.megnet_update import MEGNetUpdate # node_size_list means the first moleculae has six nodes, # and the seconde molecule has four nodes node_size_list = [6, 4] # edge_size_list means the first moleculae has eight edges, # and the s...
en
0.375429
# node_size_list means the first moleculae has six nodes, # and the seconde molecule has four nodes # edge_size_list means the first moleculae has eight edges, # and the seconde molecule has four edges # atom idx # pair idx # create start and end idx # def test_backward_cpu(update, data): # input_data, y_grad = dat...
1.949879
2
balance.py
SamarthPardhi/eth-vanity-address
0
6630722
import requests import json import sys API_TOKEN = "" def ether(add): url = "https://api.etherscan.io/api?module=account&action=balance&address=" + add + "&tag=latest&apikey=" + API_TOKEN res = requests.get(url) my_json_string = res.text to_python = json.loads(my_json_string) return to_python['res...
import requests import json import sys API_TOKEN = "" def ether(add): url = "https://api.etherscan.io/api?module=account&action=balance&address=" + add + "&tag=latest&apikey=" + API_TOKEN res = requests.get(url) my_json_string = res.text to_python = json.loads(my_json_string) return to_python['res...
none
1
2.975659
3
core/src/main/python/wlsdeploy/testing/stages/system_test_it.py
mwooten/weblogic-deploy-tooling-ct
0
6630723
""" Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. The Universal Permissive License (UPL), Version 1.0 """ import unittest from java.util import HashMap from wlsdeploy.testing import testing_helper from wlsdeploy.testing.common import system_test_support, testing_helper from wlsdeploy.te...
""" Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. The Universal Permissive License (UPL), Version 1.0 """ import unittest from java.util import HashMap from wlsdeploy.testing import testing_helper from wlsdeploy.testing.common import system_test_support, testing_helper from wlsdeploy.te...
en
0.364509
Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. The Universal Permissive License (UPL), Version 1.0 # self._step_name is actually a key into the step_names map. Use it # to get the step name object # userTestsToRun = getAndValidateUserTestsToRun(getAndValidateSupportedVersions()); # # a2cHo...
2.05869
2
Abstraction/GraphWrapper.py
xiaoningdu/deepstellar
10
6630724
<gh_stars>1-10 import numpy as np from Abstraction.DTMCGraph import DTMCGraph import json class GraphWrapper: def __init__(self, stateAbst, fake_initial=-1): self.graph = DTMCGraph(fake_initial) self.stateAbst = stateAbst def build_model(self, label_dir=None): """ Build model ...
import numpy as np from Abstraction.DTMCGraph import DTMCGraph import json class GraphWrapper: def __init__(self, stateAbst, fake_initial=-1): self.graph = DTMCGraph(fake_initial) self.stateAbst = stateAbst def build_model(self, label_dir=None): """ Build model for a specific ...
en
0.718613
Build model for a specific configuration :label_dir: file of the label profiling, currently not used. # if with labels # if without labels # break # del pca_fit # del translation_all # self.graph.draw_graph("0", "DTMC") # g_warp.graph.transitions = None # extend the graph to the steps # g_warp.visit_graph('', [...
2.422877
2
gamestonk_terminal/stocks/options/yfinance_view.py
Flodur871/GamestonkTerminal
1
6630725
<gh_stars>1-10 """Yfinance options view""" __docformat__ = "numpy" import os from bisect import bisect_left from typing import List, Dict, Any from datetime import datetime, date, timedelta import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np import pandas as pd import seaborn as sns i...
"""Yfinance options view""" __docformat__ = "numpy" import os from bisect import bisect_left from typing import List, Dict, Any from datetime import datetime, date, timedelta import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np import pandas as pd import seaborn as sns import yfinance ...
en
0.590784
Yfinance options view Plot open interest Parameters ---------- ticker: str Ticker expiry: str Expiry date for options min_sp: float Min strike to consider max_sp: float Max strike to consider calls_only: bool Show calls only puts_only: bool ...
2.660551
3
examples/videostore/videostore/model.py
arjones6/elixir
1
6630726
<filename>examples/videostore/videostore/model.py from turbogears.database import metadata, session from elixir import Unicode, DateTime, String, Integer from elixir import Entity, Field, using_options from elixir import OneToMany, ManyToOne, ManyToMany from elixir ...
<filename>examples/videostore/videostore/model.py from turbogears.database import metadata, session from elixir import Unicode, DateTime, String, Integer from elixir import Entity, Field, using_options from elixir import OneToMany, ManyToOne, ManyToMany from elixir ...
en
0.749525
# # application model # # # identity model # # create the table and mapper instances for the above entities
2.39802
2
bayescache/optimizers/rmsprop.py
jacobhinkle/bayescache
0
6630727
import torch.optim from bayescache.api import OptimizerFactory, Model class RMSpropFactory(OptimizerFactory): """ RMSprop optimizer factory """ def __init__(self, lr=1e-2, alpha=0.99, eps=1e-8, weight_decay=0, momentum=0, centered=False): self.lr = lr self.alpha = alpha self.eps = ep...
import torch.optim from bayescache.api import OptimizerFactory, Model class RMSpropFactory(OptimizerFactory): """ RMSprop optimizer factory """ def __init__(self, lr=1e-2, alpha=0.99, eps=1e-8, weight_decay=0, momentum=0, centered=False): self.lr = lr self.alpha = alpha self.eps = ep...
en
0.453904
RMSprop optimizer factory Vel factory function
2.601026
3
user/tests.py
simonprast/wopi-engine
0
6630728
from django.test import override_settings from rest_framework.test import APIRequestFactory, APITestCase, force_authenticate from .api.dev.api_views import UserCreateOrLogin, UserDetail from .models import User # Test Registration Email # This is the default email backend @override_settings(EMAIL_BACKEND='django.c...
from django.test import override_settings from rest_framework.test import APIRequestFactory, APITestCase, force_authenticate from .api.dev.api_views import UserCreateOrLogin, UserDetail from .models import User # Test Registration Email # This is the default email backend @override_settings(EMAIL_BACKEND='django.c...
en
0.900399
# Test Registration Email # This is the default email backend This function shall send a registration confirmation to a real email address. # Ask the tester if he wants to perform this test # Create a user through the API This test shall send a notification about an advisor being assigned to a user to both the user and...
2.400868
2
dependency_support/com_icarus_iverilog/build-plugins.bzl
RobSpringer/bazel_rules_hdl
0
6630729
# Copyright 2020 Google LLC # # 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, ...
# Copyright 2020 Google LLC # # 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, ...
en
0.812884
# Copyright 2020 Google LLC # # 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, ...
1.608612
2
tests/test_patterns.py
oiwn/py-crawling-goodies
3
6630730
"""Test patterns""" from pcg.patterns.singleton import Singleton def test_singleton(): """testing singleton pattern""" class Obj(metaclass=Singleton): # pylint: disable=R0903 """Test Obj class""" class AnotherObj: # pylint: disable=R0903 """Another obj""" first_instance = Obj() ...
"""Test patterns""" from pcg.patterns.singleton import Singleton def test_singleton(): """testing singleton pattern""" class Obj(metaclass=Singleton): # pylint: disable=R0903 """Test Obj class""" class AnotherObj: # pylint: disable=R0903 """Another obj""" first_instance = Obj() ...
en
0.436453
Test patterns testing singleton pattern # pylint: disable=R0903 Test Obj class # pylint: disable=R0903 Another obj
2.712903
3
st2common/tests/unit/test_crypto_utils.py
shusugmt/st2
1
6630731
<filename>st2common/tests/unit/test_crypto_utils.py # 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 Licens...
<filename>st2common/tests/unit/test_crypto_utils.py # 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 Licens...
en
0.860506
# 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.734424
2
synth.py
nielm/nodejs-spanner
0
6630732
import synthtool as s import synthtool.gcp as gcp import synthtool.languages.node as node import logging from pathlib import Path logging.basicConfig(level=logging.DEBUG) AUTOSYNTH_MULTIPLE_COMMITS = True gapic = gcp.GAPICBazel() spanner = gapic.node_library('spanner', 'v1', proto_path='google/spanner/v1') spanner...
import synthtool as s import synthtool.gcp as gcp import synthtool.languages.node as node import logging from pathlib import Path logging.basicConfig(level=logging.DEBUG) AUTOSYNTH_MULTIPLE_COMMITS = True gapic = gcp.GAPICBazel() spanner = gapic.node_library('spanner', 'v1', proto_path='google/spanner/v1') spanner...
en
0.862649
# nodejs-spanner is composed of 3 APIs: SpannerClient, SpannerAdminDatabase and # SpannerAdminInstance, all 3 are exported in src/v1/index.js # Excluding auto-generated system test since Spanner has its own packing test
1.87906
2
torchvision/models/quantization/googlenet.py
SliMM/vision
2
6630733
import warnings import torch import torch.nn as nn from torch.nn import functional as F from torchvision.models.utils import load_state_dict_from_url from torchvision.models.googlenet import ( GoogLeNetOutputs, BasicConv2d, Inception, InceptionAux, GoogLeNet, model_urls) from .utils import _replace_relu, quantize...
import warnings import torch import torch.nn as nn from torch.nn import functional as F from torchvision.models.utils import load_state_dict_from_url from torchvision.models.googlenet import ( GoogLeNetOutputs, BasicConv2d, Inception, InceptionAux, GoogLeNet, model_urls) from .utils import _replace_relu, quantize...
en
0.785788
# fp32 GoogLeNet ported from TensorFlow, with weights quantized in PyTorch GoogLeNet (Inception v1) model architecture from `"Going Deeper with Convolutions" <http://arxiv.org/abs/1409.4842>`_. Note that quantize = True returns a quantized model with 8 bit weights. Quantized models only support inference a...
2.451438
2
cbng_trainer/cli.py
cluebotng/trainer
0
6630734
#!/usr/bin/env python3 ''' 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 restriction, including without limitation the rights to use, copy, modify,...
#!/usr/bin/env python3 ''' 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 restriction, including without limitation the rights to use, copy, modify,...
en
0.754698
#!/usr/bin/env python3 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 restriction, including without limitation the rights to use, copy, modify, mer...
1.575282
2
ajenga/plugin/__init__.py
project-ajenga/Core
0
6630735
from .service import Privilege from .service import Service from .service import remove_service from .service import set_current_plugin from .plugin import Plugin from .plugin import get_current_plugin from .plugin import get_loaded_plugins from .plugin import get_plugin from .plugin import load_plugin from .plugin imp...
from .service import Privilege from .service import Service from .service import remove_service from .service import set_current_plugin from .plugin import Plugin from .plugin import get_current_plugin from .plugin import get_loaded_plugins from .plugin import get_plugin from .plugin import load_plugin from .plugin imp...
none
1
1.141136
1
lobster/audio.py
noahfx/lobster
6
6630736
import subprocess from pydub import AudioSegment from .filemanager import get_workingdir, get_album_dir class StreamSegment(object): def __init__(self, name, position, initial_time=None, end_time=None): self.name = name self.position = position self.initial_time = initial_time self...
import subprocess from pydub import AudioSegment from .filemanager import get_workingdir, get_album_dir class StreamSegment(object): def __init__(self, name, position, initial_time=None, end_time=None): self.name = name self.position = position self.initial_time = initial_time self...
en
0.818715
Sets initial time/end time for segments #separator between track, milseconds Splits audio file given the time range in audio segments Exports webm file to mp3 or ogg format file, replaces pydub export due to issues with ffmpeg
2.91631
3
src/izi/apps/shipping/migrations/0001_initial.py
izi-core/izi-core
0
6630737
<filename>src/izi/apps/shipping/migrations/0001_initial.py # Generated by Django 2.1.1 on 2018-10-01 04:05 from decimal import Decimal import django.core.validators from django.db import migrations, models import django.db.models.deletion import izi.models.fields.autoslugfield class Migration(migrations.Migration): ...
<filename>src/izi/apps/shipping/migrations/0001_initial.py # Generated by Django 2.1.1 on 2018-10-01 04:05 from decimal import Decimal import django.core.validators from django.db import migrations, models import django.db.models.deletion import izi.models.fields.autoslugfield class Migration(migrations.Migration): ...
en
0.77519
# Generated by Django 2.1.1 on 2018-10-01 04:05
1.840187
2
inverness/model_meta.py
mobarski/inverness
0
6630738
from tqdm import tqdm try: from .util_time import timed from .sorbet import sorbet except (ModuleNotFoundError,ImportError): from util_time import timed from sorbet import sorbet class Meta(): @timed def init_meta(self, storage='disk'): self.meta = sorbet(self.path+'meta', kind=storage).new() get_meta = s...
from tqdm import tqdm try: from .util_time import timed from .sorbet import sorbet except (ModuleNotFoundError,ImportError): from util_time import timed from sorbet import sorbet class Meta(): @timed def init_meta(self, storage='disk'): self.meta = sorbet(self.path+'meta', kind=storage).new() get_meta = s...
none
1
2.304651
2
djmod/modlearn/web/migrations/0012_auto_20170321_1736.py
hosseinmh/Django_learning
0
6630739
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-21 17:36 from __future__ import unicode_literals from django.db import migrations, models import web.validators class Migration(migrations.Migration): dependencies = [ ('web', '0011_auto_20170321_1525'), ] operations = [ mi...
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-21 17:36 from __future__ import unicode_literals from django.db import migrations, models import web.validators class Migration(migrations.Migration): dependencies = [ ('web', '0011_auto_20170321_1525'), ] operations = [ mi...
en
0.780702
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-21 17:36
1.689176
2
users/migrations/0001_initial.py
intelligems/stolos
5
6630740
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-09-06 14:10 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): initial = True dependencies = [ ...
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-09-06 14:10 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): initial = True dependencies = [ ...
en
0.807838
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-09-06 14:10
1.802693
2
tensorflow/basic-rl/tutorial10/gps/gui/config.py
gopala-kr/ds-notebooks
1
6630741
<filename>tensorflow/basic-rl/tutorial10/gps/gui/config.py<gh_stars>1-10 """ Default configuration and hyperparameter values for GUI objects. """ import itertools #from gps.proto.gps_pb2 import TRIAL_ARM, AUXILIARY_ARM from gps_pb2 import TRIAL_ARM, AUXILIARY_ARM from gps.gui.ps3_config import PS3_BUTTON, INVERTED_PS3...
<filename>tensorflow/basic-rl/tutorial10/gps/gui/config.py<gh_stars>1-10 """ Default configuration and hyperparameter values for GUI objects. """ import itertools #from gps.proto.gps_pb2 import TRIAL_ARM, AUXILIARY_ARM from gps_pb2 import TRIAL_ARM, AUXILIARY_ARM from gps.gui.ps3_config import PS3_BUTTON, INVERTED_PS3...
en
0.669409
Default configuration and hyperparameter values for GUI objects. #from gps.proto.gps_pb2 import TRIAL_ARM, AUXILIARY_ARM # Mappings from actions to their corresponding keyboard bindings. # WARNING: keybindings must be unique # Target Setup. # previous target number # next target number # previous actuator type # next a...
2.362337
2
main.py
AI-secure/VeriGauge
54
6630742
<reponame>AI-secure/VeriGauge<gh_stars>10-100 import os os.environ["CUDA_VISIBLE_DEVICES"] = '1' import sys import datasets import model APPROACH_LIST = ['PGD', 'IBP', 'FastLin', 'MILP', 'PercySDP', 'ZicoDual', 'CROWN', 'CROWN-IBP', 'LPAll' 'Diffai', 'RecurJac', 'FastLip'] dataset = 'mnist' # source = 'test' # selec...
import os os.environ["CUDA_VISIBLE_DEVICES"] = '1' import sys import datasets import model APPROACH_LIST = ['PGD', 'IBP', 'FastLin', 'MILP', 'PercySDP', 'ZicoDual', 'CROWN', 'CROWN-IBP', 'LPAll' 'Diffai', 'RecurJac', 'FastLip'] dataset = 'mnist' # source = 'test' # selector = 'small.3' source = 'fastlin' selector = ...
en
0.190975
# source = 'test' # selector = 'small.3' # source = 'cnn_cert' # selector = '3layer_fc_20' # ibp = IBPAdaptor(dataset, m) # fastlinibp = FastLinIBPAdaptor(dataset, m) # milp = MILPAdaptor(dataset, m) # fullcrown = FullCrownAdaptor(dataset, m) # crownibp = CrownIBPAdaptor(dataset, m) # fastlip = FastLipAdaptor(dataset, ...
1.961073
2
solis_service/persistence/__init__.py
anszom/solis-service
11
6630743
<filename>solis_service/persistence/__init__.py<gh_stars>10-100 from contextlib import contextmanager from .influxdb_persistence_client import InfluxDbPersistenceClient @contextmanager def persistence_client(config): client = None try: persistence_type = config["service"]["persistence"] if pe...
<filename>solis_service/persistence/__init__.py<gh_stars>10-100 from contextlib import contextmanager from .influxdb_persistence_client import InfluxDbPersistenceClient @contextmanager def persistence_client(config): client = None try: persistence_type = config["service"]["persistence"] if pe...
none
1
2.127302
2
src/the_tale/the_tale/linguistics/conf.py
devapromix/the-tale
1
6630744
import smart_imports smart_imports.all() settings = dext_app_settings.app_settings('LINGUISTICS_SETTINGS', WORDS_ON_PAGE=25, TEMPLATES_ON_PAGE=25, MODERATOR_GROUP_NAME='linguistics moderator...
import smart_imports smart_imports.all() settings = dext_app_settings.app_settings('LINGUISTICS_SETTINGS', WORDS_ON_PAGE=25, TEMPLATES_ON_PAGE=25, MODERATOR_GROUP_NAME='linguistics moderator...
none
1
1.745282
2
utils/code_generator/time_measurement/phase_1/generate_job_files.py
zehor-l/tiramisu
23
6630745
<filename>utils/code_generator/time_measurement/phase_1/generate_job_files.py """ Generate the job files needed by the sbatch command. Here's an example of a job file : #!/bin/bash #SBATCH --job-name=comp2 #SBATCH --output=log/log_comp_2_6842_10263 #SBATCH -N 1 #SBATCH --exclusive #SBATCH -p lanka-v3 srun python3 com...
<filename>utils/code_generator/time_measurement/phase_1/generate_job_files.py """ Generate the job files needed by the sbatch command. Here's an example of a job file : #!/bin/bash #SBATCH --job-name=comp2 #SBATCH --output=log/log_comp_2_6842_10263 #SBATCH -N 1 #SBATCH --exclusive #SBATCH -p lanka-v3 srun python3 com...
en
0.59706
Generate the job files needed by the sbatch command. Here's an example of a job file : #!/bin/bash #SBATCH --job-name=comp2 #SBATCH --output=log/log_comp_2_6842_10263 #SBATCH -N 1 #SBATCH --exclusive #SBATCH -p lanka-v3 srun python3 compile_tiramisu_code.py 6842 10263 2 # Number of nodes in the cluster # Each node wi...
2.595151
3
script/bootstrap.py
renhongl/electron
5
6630746
<reponame>renhongl/electron #!/usr/bin/env python import argparse import os import subprocess import sys from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ enable_verbose_mode, is_verbose_mode, get_target_arch from lib.util import execute_stdout, get_atom_shell_version, sco...
#!/usr/bin/env python import argparse import os import subprocess import sys from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ enable_verbose_mode, is_verbose_mode, get_target_arch from lib.util import execute_stdout, get_atom_shell_version, scoped_cwd SOURCE_ROOT = os.p...
en
0.728248
#!/usr/bin/env python # Use prebuilt clang for building native modules. # Ignore npm install errors when running in CI. # We update the file only if the content has changed (ignoring line ending # differences).
1.984026
2
tests/__init__.py
ericmjl/seqlike
186
6630747
import os import pathlib test_path = pathlib.Path(os.path.abspath(os.path.dirname(__file__)))
import os import pathlib test_path = pathlib.Path(os.path.abspath(os.path.dirname(__file__)))
none
1
1.809192
2
tests/ut/python/adv_robustness/attacks/test_cw.py
hboshnak/mindarmour
0
6630748
# Copyright 2019 Huawei Technologies Co., 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-2.0 # # Unless required by applicable law or agreed to...
# Copyright 2019 Huawei Technologies Co., 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-2.0 # # Unless required by applicable law or agreed to...
en
0.821862
# Copyright 2019 Huawei Technologies Co., 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-2.0 # # Unless required by applicable law or agreed to...
2.068128
2
workflows/wf_quasiparticle.py
abelcarreras/aiida_extensions
0
6630749
<filename>workflows/wf_quasiparticle.py from aiida.orm import Code, DataFactory, WorkflowFactory from aiida.orm.workflow import Workflow #from aiida.workflows.wf_phonon import WorkflowPhonon from aiida.orm import load_node, load_workflow from aiida.orm.calculation.inline import make_inline WorkflowPhonon = WorkflowFac...
<filename>workflows/wf_quasiparticle.py from aiida.orm import Code, DataFactory, WorkflowFactory from aiida.orm.workflow import Workflow #from aiida.workflows.wf_phonon import WorkflowPhonon from aiida.orm import load_node, load_workflow from aiida.orm.calculation.inline import make_inline WorkflowPhonon = WorkflowFac...
en
0.672477
#from aiida.workflows.wf_phonon import WorkflowPhonon # By default optimized structure is used # By default optimization is done # Calculates the reference crystal structure (optimize it if requested) # wf = load_workflow(127) # Generate the volume expanded cells # self.append_to_report('created MD calculation w...
2.111434
2
zeitcoinforth.py
mmgrant73/zeitcoin
1
6630750
#!/usr/local/bin/python import sys, re, hashlib from M2Crypto import Rand, RSA, BIO class zeitforth: ds = [] # The data stack cStack = [] # The control struct stack heap = [0]*20 # The data heap heapNext = 0 # Next avail slot in heap words = [] # The inpu...
#!/usr/local/bin/python import sys, re, hashlib from M2Crypto import Rand, RSA, BIO class zeitforth: ds = [] # The data stack cStack = [] # The control struct stack heap = [0]*20 # The data heap heapNext = 0 # Next avail slot in heap words = [] # The inpu...
en
0.763161
#!/usr/local/bin/python # The data stack # The control struct stack # The data heap # Next avail slot in heap # The input stream of tokens #============================== Lexical Parsing # clip comments, split to list of words # Use "#" for comment to end of line #================================= Runtime operation #pr...
3.087684
3