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 |
|---|---|---|---|---|---|---|---|---|---|---|
tests/util_functions_tests/test_utils.py | michaelhall28/darwinian_shift | 0 | 6632551 | from darwinian_shift.utils.util_functions import *
from tests.conftest import sort_dataframe, compare_sorted_files, MUTATION_DATA_FILE, TEST_DATA_DIR
from darwinian_shift.reference_data.reference_utils import get_source_genome_reference_file_paths
from pandas.testing import assert_frame_equal
import filecmp
import os
... | from darwinian_shift.utils.util_functions import *
from tests.conftest import sort_dataframe, compare_sorted_files, MUTATION_DATA_FILE, TEST_DATA_DIR
from darwinian_shift.reference_data.reference_utils import get_source_genome_reference_file_paths
from pandas.testing import assert_frame_equal
import filecmp
import os
... | none | 1 | 2.519172 | 3 | |
loop-operators.py | EnescanAkyuz/Python_Beginner | 4 | 6632552 | # string = 'hello'
# list = []
# for result in string:
# list.append(result)
# print(list)
# #bu iki işlem aynı
# mylist = [result for result in string]
# print(mylist)
# years = [2002,1976,1979,2007,1956]
# age = [2020-year for year in years]
# print(age)
numbers = []
... | # string = 'hello'
# list = []
# for result in string:
# list.append(result)
# print(list)
# #bu iki işlem aynı
# mylist = [result for result in string]
# print(mylist)
# years = [2002,1976,1979,2007,1956]
# age = [2020-year for year in years]
# print(age)
numbers = []
... | en | 0.456527 | # string = 'hello' # list = [] # for result in string: # list.append(result) # print(list) # #bu iki işlem aynı # mylist = [result for result in string] # print(mylist) # years = [2002,1976,1979,2007,1956] # age = [2020-year for year in years] # print(age) | 4.213524 | 4 |
digger/database/__init__.py | fxxkrlab/Digger | 0 | 6632553 | from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
from urllib import parse
from modules import load
db = load._cfg["database"]
db_string = db["connect"]
db_user = parse.quote_plus(f"{db['user']}")
db_passwd = parse.quo... | from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
from urllib import parse
from modules import load
db = load._cfg["database"]
db_string = db["connect"]
db_user = parse.quote_plus(f"{db['user']}")
db_passwd = parse.quo... | none | 1 | 2.571733 | 3 | |
consumer/test.py | Kareem-Emad/switch | 2 | 6632554 | import unittest
import responses
import json
from requests import ConnectionError
from utils import check_filter_expression_satisfied, parse_message, process_job
class TestUtils(unittest.TestCase):
def test_filters_should_include_body_data_in_expression_happy(self):
"""
filters should allow you t... | import unittest
import responses
import json
from requests import ConnectionError
from utils import check_filter_expression_satisfied, parse_message, process_job
class TestUtils(unittest.TestCase):
def test_filters_should_include_body_data_in_expression_happy(self):
"""
filters should allow you t... | en | 0.867785 | filters should allow you to use the data from the body/headrs/query_params as varaibles in the boolean expression happy scenario should equate to true filters should allow you to use the data from the body/headrs/query_params as varaibles in the boolean expression fail scenario should eq... | 2.898209 | 3 |
src/sage/parallel/use_fork.py | saraedum/sage-renamed | 3 | 6632555 | <filename>src/sage/parallel/use_fork.py
"""
Parallel iterator built using the ``fork()`` system call
"""
#*****************************************************************************
# Copyright (C) 2010 <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the ter... | <filename>src/sage/parallel/use_fork.py
"""
Parallel iterator built using the ``fork()`` system call
"""
#*****************************************************************************
# Copyright (C) 2010 <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the ter... | en | 0.698689 | Parallel iterator built using the ``fork()`` system call #***************************************************************************** # Copyright (C) 2010 <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published... | 2.435136 | 2 |
lusidtools/lpt/map_instruments.py | entityoneuk/lusid-python-tools | 1 | 6632556 | <filename>lusidtools/lpt/map_instruments.py<gh_stars>1-10
import os
import pandas as pd
from lusidtools.lpt import lpt
from lusidtools.lpt import lse
from lusidtools.lpt import stdargs
from lusidtools.lpt.either import Either
mapping_prefixes = {"Figi": "FIGI", "ClientInternal": "INT", "QuotePermId": "QPI"}
mapping... | <filename>lusidtools/lpt/map_instruments.py<gh_stars>1-10
import os
import pandas as pd
from lusidtools.lpt import lpt
from lusidtools.lpt import lse
from lusidtools.lpt import stdargs
from lusidtools.lpt.either import Either
mapping_prefixes = {"Figi": "FIGI", "ClientInternal": "INT", "QuotePermId": "QPI"}
mapping... | en | 0.797532 | # temporary column name # Apply any known mappings to avoid unecessary i/o # updates the mappings table # records to process now # remaining records # called if the get_instruments() succeeds # Update successfully found items # For un-mapped internal codes, we will try to add (upsert) # called if the upsert_instruments... | 2.451305 | 2 |
covid19_id/update_covid19/update.py | hexatester/covid19-id | 0 | 6632557 | import attr
from datetime import datetime
from typing import List, Optional
from . import Penambahan
from . import Harian
from . import Total
@attr.dataclass(slots=True)
class Update:
penambahan: Penambahan
harian: List[Harian]
total: Total
_today: Optional[Harian] = None
@property
def today... | import attr
from datetime import datetime
from typing import List, Optional
from . import Penambahan
from . import Harian
from . import Total
@attr.dataclass(slots=True)
class Update:
penambahan: Penambahan
harian: List[Harian]
total: Total
_today: Optional[Harian] = None
@property
def today... | none | 1 | 2.873542 | 3 | |
oxasl/prequantify.py | ibme-qubic/oxasl | 1 | 6632558 | <reponame>ibme-qubic/oxasl
#!/bin/env python
"""
OXASL - Pre-quantification module
This is run before model fitting and should generate effectively differenced ASL data
e.g. by multiphase decoding
Copyright (c) 2008-2020 Univerisity of Oxford
"""
try:
import oxasl_mp
except ImportError:
oxasl_mp = None
... | #!/bin/env python
"""
OXASL - Pre-quantification module
This is run before model fitting and should generate effectively differenced ASL data
e.g. by multiphase decoding
Copyright (c) 2008-2020 Univerisity of Oxford
"""
try:
import oxasl_mp
except ImportError:
oxasl_mp = None
def run(wsp):
if wsp.as... | en | 0.780724 | #!/bin/env python OXASL - Pre-quantification module This is run before model fitting and should generate effectively differenced ASL data e.g. by multiphase decoding Copyright (c) 2008-2020 Univerisity of Oxford | 2.348059 | 2 |
deform/tests/test_api.py | sixfeetup/deform | 0 | 6632559 | import unittest
class TestAPI(unittest.TestCase):
def test_it(self):
# none of these imports should fail
from deform import Form
from deform import Button
from deform import Field
from deform import FileData
from deform import ValidationFailure
from deform ... | import unittest
class TestAPI(unittest.TestCase):
def test_it(self):
# none of these imports should fail
from deform import Form
from deform import Button
from deform import Field
from deform import FileData
from deform import ValidationFailure
from deform ... | en | 0.878856 | # none of these imports should fail | 1.890921 | 2 |
cutters.py | CockHeroJoe/CHAP | 0 | 6632560 | <reponame>CockHeroJoe/CHAP
from abc import ABCMeta, abstractmethod
import random
from contextlib import ExitStack
from tkinter import TclError
from moviepy.Clip import Clip
from moviepy.video.io.VideoFileClip import VideoFileClip
from moviepy.video.fx.resize import resize
from utils import draw_progress_bar,... | from abc import ABCMeta, abstractmethod
import random
from contextlib import ExitStack
from tkinter import TclError
from moviepy.Clip import Clip
from moviepy.video.io.VideoFileClip import VideoFileClip
from moviepy.video.fx.resize import resize
from utils import draw_progress_bar, SourceFile
from parsing i... | en | 0.822291 | # Cut randomized clips from random videos in chronological order # Select random clip length that is a whole multiple of beats long # Use beatmeter generator config: time cuts to beats perfectly # compute number of subsections in this pattern and length # Go to next beat pattern section # First cut in round is longer, ... | 2.000347 | 2 |
qf_lib/backtesting/events/time_event/periodic_event/periodic_event.py | webclinic017/qf-lib | 198 | 6632561 | # Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... | # Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... | en | 0.823512 | # Copyright 2016-present CERN – European Organization for Nuclear Research # # 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... | 2.197229 | 2 |
storage_integration/controller.py | frappe/storage_integration | 8 | 6632562 | <reponame>frappe/storage_integration
import frappe
from frappe.utils.password import get_decrypted_password
import os
import re
from minio import Minio
from urllib.parse import urlparse, parse_qs
class MinioConnection:
def __init__(self, doc):
self.settings = frappe.get_doc("Storage Integration Settings", None)
... | import frappe
from frappe.utils.password import get_decrypted_password
import os
import re
from minio import Minio
from urllib.parse import urlparse, parse_qs
class MinioConnection:
def __init__(self, doc):
self.settings = frappe.get_doc("Storage Integration Settings", None)
self.file = doc
self.client = Minio... | en | 0.849396 | # if file already on s3 # on upload successful create storage_backup_doc() | 2.285351 | 2 |
scripts/migration/set_unique_challenge_slug.py | kaustubh-s1/EvalAI | 1,470 | 6632563 | <reponame>kaustubh-s1/EvalAI
# To run the file:
# 1. Open django shell using -- python manage.py shell
# 2. Run the script in shell -- exec(open('scripts/migration/set_unique_challenge_slug.py').read())
from challenges.models import Challenge
def set_challenge_slug_as_unique():
challenges = Challenge.objects.all... | # To run the file:
# 1. Open django shell using -- python manage.py shell
# 2. Run the script in shell -- exec(open('scripts/migration/set_unique_challenge_slug.py').read())
from challenges.models import Challenge
def set_challenge_slug_as_unique():
challenges = Challenge.objects.all()
try:
for chall... | en | 0.389295 | # To run the file: # 1. Open django shell using -- python manage.py shell # 2. Run the script in shell -- exec(open('scripts/migration/set_unique_challenge_slug.py').read()) | 2.60505 | 3 |
tests/pasio_parallel_wrapper.py | autosome-ru/pasio | 0 | 6632564 | import argparse
import os
import logging
import tempfile
import pasio
logger = logging.getLogger(__name__)
stderr = logging.StreamHandler()
stderr.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
stderr.setFormatter(formatter)
logger.addHandler(stderr)
logger.setLevel(... | import argparse
import os
import logging
import tempfile
import pasio
logger = logging.getLogger(__name__)
stderr = logging.StreamHandler()
stderr.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
stderr.setFormatter(formatter)
logger.addHandler(stderr)
logger.setLevel(... | none | 1 | 2.549735 | 3 | |
projetos/aula/operators/logical-operators.py | GiuseppeMP/udacity-fundamentos-ia-machine-learning | 0 | 6632565 | '''and True if both the operands are true x and y
or True if either of the operands is true x or y
not True if operand is false (complements the operand) not x'''
x = True
y = False
# Output: x and y is False
print('x and y is',x and y)
# Output: x or y is True
print('x or y is',x or y)
# Output: not x is False
pri... | '''and True if both the operands are true x and y
or True if either of the operands is true x or y
not True if operand is false (complements the operand) not x'''
x = True
y = False
# Output: x and y is False
print('x and y is',x and y)
# Output: x or y is True
print('x or y is',x or y)
# Output: not x is False
pri... | en | 0.779289 | and True if both the operands are true x and y or True if either of the operands is true x or y not True if operand is false (complements the operand) not x # Output: x and y is False # Output: x or y is True # Output: not x is False | 4.329314 | 4 |
tests/test_models.py | dopry/orm | 0 | 6632566 | <filename>tests/test_models.py
import asyncio
import functools
import pytest
import sqlalchemy
import databases
import orm
from tests.settings import DATABASE_URL
database = databases.Database(DATABASE_URL, force_rollback=True)
metadata = sqlalchemy.MetaData()
class User(orm.Model):
__tablename__ = "users"
... | <filename>tests/test_models.py
import asyncio
import functools
import pytest
import sqlalchemy
import databases
import orm
from tests.settings import DATABASE_URL
database = databases.Database(DATABASE_URL, force_rollback=True)
metadata = sqlalchemy.MetaData()
class User(orm.Model):
__tablename__ = "users"
... | en | 0.734049 | Decorator used to run async test cases. # Test escaping % character from icontains, contains, and iexact | 2.286574 | 2 |
test.py | wgy5446/TIL | 1 | 6632567 | <filename>test.py
aaaa`:wq
aaaa
| <filename>test.py
aaaa`:wq
aaaa
| none | 1 | 0.863636 | 1 | |
customerio/__init__.py | hungrydk/customerio-python | 34 | 6632568 | <gh_stars>10-100
import warnings
from customerio.client_base import CustomerIOException
from customerio.track import CustomerIO
from customerio.api import APIClient, SendEmailRequest
from customerio.regions import Regions
| import warnings
from customerio.client_base import CustomerIOException
from customerio.track import CustomerIO
from customerio.api import APIClient, SendEmailRequest
from customerio.regions import Regions | none | 1 | 1.072237 | 1 | |
pymetabolism/lpmodels.py | Midnighter/pymetabolism | 1 | 6632569 | <filename>pymetabolism/lpmodels.py<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
====================
LP Solver Interfaces
====================
:Authors:
<NAME>
<NAME>
<NAME>
:Date:
2011-03-28
:Copyright:
Copyright(c) 2011 Jacobs University of Bremen. All rights reserved.
:File:... | <filename>pymetabolism/lpmodels.py<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
====================
LP Solver Interfaces
====================
:Authors:
<NAME>
<NAME>
<NAME>
:Date:
2011-03-28
:Copyright:
Copyright(c) 2011 Jacobs University of Bremen. All rights reserved.
:File:... | en | 0.638232 | #!/usr/bin/env python # -*- coding: utf-8 -*- ==================== LP Solver Interfaces ==================== :Authors: <NAME> <NAME> <NAME> :Date: 2011-03-28 :Copyright: Copyright(c) 2011 Jacobs University of Bremen. All rights reserved. :File: lpmodels.py Meta class that, according to the solv... | 2.458836 | 2 |
backend/api/battles/serializers.py | pantoja/PokeBattle | 0 | 6632570 | from rest_framework import exceptions, serializers
from api.battles.helpers import order_pokemon_in_team
from api.pokemon.serializers import PokemonSerializer
from api.users.serializers import UserSerializer
from battles.choices import POKEMON_ORDER_CHOICES
from battles.helpers.common import duplicate_in_set, pokemon_... | from rest_framework import exceptions, serializers
from api.battles.helpers import order_pokemon_in_team
from api.pokemon.serializers import PokemonSerializer
from api.users.serializers import UserSerializer
from battles.choices import POKEMON_ORDER_CHOICES
from battles.helpers.common import duplicate_in_set, pokemon_... | none | 1 | 2.362895 | 2 | |
env/lib/python3.6/site-packages/scipy/stats/tests/test_tukeylambda_stats.py | anthowen/duplify | 6,989 | 6632571 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from scipy.stats._tukeylambda_stats import (tukeylambda_variance,
tukeylambda_kurtosis)
def test_tukeylambda_stats_known_exact():
... | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from scipy.stats._tukeylambda_stats import (tukeylambda_variance,
tukeylambda_kurtosis)
def test_tukeylambda_stats_known_exact():
... | en | 0.799724 | Compare results with some known exact formulas. # Some exact values of the Tukey Lambda variance and kurtosis: # lambda var kurtosis # 0 pi**2/3 6/5 (logistic distribution) # 0.5 4 - pi (5/3 - pi/2)/(pi/4 - 1)**2 - 3 # 1 1/3 -6/5 (uniform distribution on (-1,1)) # 2 1... | 2.38423 | 2 |
application/models/event.py | ukayaj620/itevenz | 0 | 6632572 | <filename>application/models/event.py<gh_stars>0
from application.app import db
class Event(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), unique=False, nullable=False)
title = db.Column(db.String(255), unique=False, nullable... | <filename>application/models/event.py<gh_stars>0
from application.app import db
class Event(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), unique=False, nullable=False)
title = db.Column(db.String(255), unique=False, nullable... | none | 1 | 2.355268 | 2 | |
test/internet_tests/test_post_submit.py | brikkho-net/windmill | 61 | 6632573 | from windmill.authoring import WindmillTestClient
def test_post_submit():
client = WindmillTestClient(__name__)
client.open(url=u'http://tutorial.getwindmill.com/windmill-unittests/domain_switcher.html')
client.type(text=u'simpletest', name=u'search_theme_form')
client.click(name=u'op')
client.wait... | from windmill.authoring import WindmillTestClient
def test_post_submit():
client = WindmillTestClient(__name__)
client.open(url=u'http://tutorial.getwindmill.com/windmill-unittests/domain_switcher.html')
client.type(text=u'simpletest', name=u'search_theme_form')
client.click(name=u'op')
client.wait... | none | 1 | 2.531265 | 3 | |
tests/db/test_client.py | Veritaris/fastapi_contrib | 504 | 6632574 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from fastapi import FastAPI
from fastapi_contrib.db.client import MongoDBClient
from fastapi_contrib.db.models import MongoDBModel, MongoDBTimeStampedModel
from tests.mock import MongoDBMock
from tests.utils import override_settings, AsyncMock, AsyncIterator... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from fastapi import FastAPI
from fastapi_contrib.db.client import MongoDBClient
from fastapi_contrib.db.models import MongoDBModel, MongoDBTimeStampedModel
from tests.mock import MongoDBMock
from tests.utils import override_settings, AsyncMock, AsyncIterator... | en | 0.636026 | #!/usr/bin/env python # -*- coding: utf-8 -*- # Test whether it correctly handles filter by non-id # Test whether it correctly handles filter by non-id # Test whether it correctly handles filter by non-id # Test whether it correctly handles filter by non-id # Test whether it correctly handles filter by non-id # Test wh... | 2.134696 | 2 |
setup.py | holmosapien/PyGerbv | 0 | 6632575 | from setuptools import setup, find_packages
import os, sys
stable = os.environ.get('PYGERBV_STABLE', "YES")
branch_name = os.environ.get('PYGERBV_BRANCH', None)
if stable == "YES":
version_format = '{tag}'
classifiers = [
'Development Status :: 5 - Production/Stable',
'License :: Other/Proprie... | from setuptools import setup, find_packages
import os, sys
stable = os.environ.get('PYGERBV_STABLE', "YES")
branch_name = os.environ.get('PYGERBV_BRANCH', None)
if stable == "YES":
version_format = '{tag}'
classifiers = [
'Development Status :: 5 - Production/Stable',
'License :: Other/Proprie... | en | 0.226674 | # Add enum34 **ONLY** if necessary -- installing in 3.5+ will break things | 1.769689 | 2 |
drhard/star/prepare_hardneg.py | tonellotto/drhard | 69 | 6632576 | <filename>drhard/star/prepare_hardneg.py
import sys
sys.path.append('./')
import os
import json
import random
import argparse
import faiss
import logging
import numpy as np
import torch
import subprocess
from transformers import RobertaConfig
from tqdm import tqdm
from model import RobertaDot
from dataset import load_r... | <filename>drhard/star/prepare_hardneg.py
import sys
sys.path.append('./')
import os
import json
import random
import argparse
import faiss
import logging
import numpy as np
import torch
import subprocess
from transformers import RobertaConfig
from tqdm import tqdm
from model import RobertaDot
from dataset import load_r... | none | 1 | 1.938685 | 2 | |
tests/test_apk.py | pytxxy/creditutils | 0 | 6632577 | # -*- coding:UTF-8 -*-
'''
Created on 2013年10月28日
@author: work_cfh
'''
import unittest
import creditutils.apk_util as apk
import pprint
class Test(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testName(self):
pass
def test_extract_apk_info():
a... | # -*- coding:UTF-8 -*-
'''
Created on 2013年10月28日
@author: work_cfh
'''
import unittest
import creditutils.apk_util as apk
import pprint
class Test(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testName(self):
pass
def test_extract_apk_info():
a... | zh | 0.32762 | # -*- coding:UTF-8 -*- Created on 2013年10月28日 @author: work_cfh # apk_path = r'D:\temp\qing.apk' # import sys;sys.argv = ['', 'Test.testName'] # unittest.main() # test_extract_apk_info() | 2.244165 | 2 |
seqal/data.py | tech-sketch/SeqAL | 0 | 6632578 | <filename>seqal/data.py
import functools
from collections import defaultdict
from dataclasses import dataclass
from typing import Dict, List, Optional
import torch
from flair.data import Span
@dataclass
class Entity:
"""Entity with predicted information"""
id: int # Entity id in the same sentence
sent_... | <filename>seqal/data.py
import functools
from collections import defaultdict
from dataclasses import dataclass
from typing import Dict, List, Optional
import torch
from flair.data import Span
@dataclass
class Entity:
"""Entity with predicted information"""
id: int # Entity id in the same sentence
sent_... | en | 0.685299 | Entity with predicted information # Entity id in the same sentence # Sentence id # Entity span # Cluster number Get entity embeddings Get entity label Get entity text Entity list Add entity to list Group entities by sentence Group entities by label Group entities by cluster | 2.496592 | 2 |
tensorflow_federated/python/aggregators/primitives.py | truthiswill/federated | 1 | 6632579 | <reponame>truthiswill/federated
# Copyright 2019, The TensorFlow Federated Authors.
#
# 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
#
# Unl... | # Copyright 2019, The TensorFlow Federated Authors.
#
# 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... | en | 0.823154 | # Copyright 2019, The TensorFlow Federated Authors. # # 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.77151 | 2 |
maven/tests/dicts_test.bzl | KelvinLu/bazel_maven_repository | 0 | 6632580 | <reponame>KelvinLu/bazel_maven_repository<filename>maven/tests/dicts_test.bzl
load(":testing.bzl", "asserts", "test_suite")
load("//maven:utils.bzl", "dicts")
def encode_test(env):
nested = {
"foo": "bar",
"blah": {
"a": "b",
"c": "d",
}
}
expected = {
... | load(":testing.bzl", "asserts", "test_suite")
load("//maven:utils.bzl", "dicts")
def encode_test(env):
nested = {
"foo": "bar",
"blah": {
"a": "b",
"c": "d",
}
}
expected = {
"foo": "bar",
"blah": ["a>>>b", "c>>>d"],
}
asserts.equals(... | en | 0.535715 | # Roll-up function. | 2.189579 | 2 |
2onnx_resnet.py | Yifanfanfanfan/flops-counter.pytorch | 0 | 6632581 | <filename>2onnx_resnet.py
import os, sys, time, shutil, argparse
from functools import partial
import pickle
sys.path.append('../')
import torch
import torch.nn as nn
from torch.autograd import Variable
from torchvision import datasets, transforms
#import torchvision.models as models
import torch.optim as optim
import ... | <filename>2onnx_resnet.py
import os, sys, time, shutil, argparse
from functools import partial
import pickle
sys.path.append('../')
import torch
import torch.nn as nn
from torch.autograd import Variable
from torchvision import datasets, transforms
#import torchvision.models as models
import torch.optim as optim
import ... | en | 0.400596 | #import torchvision.models as models # import prune_util # from prune_util import GradualWarmupScheduler # from prune_util import CrossEntropyLossMaybeSmooth # from prune_util import mixup_data, mixup_criterion # from utils import save_checkpoint, AverageMeter, visualize_image, GrayscaleImageFolder # from model import ... | 1.973321 | 2 |
programs/witness_node/saltpass.py | techsharesteam/techshares | 0 | 6632582 | #!/usr/bin/env python3
import base64
import getpass
import hashlib
import json
import os
pw = getpass.getpass("enter your password: ")
pw_bytes = pw.encode("utf-8")
salt_bytes = os.urandom(8)
salt_b64 = base64.b64encode( salt_bytes )
pw_hash = hashlib.sha256( pw_bytes + salt_bytes ).digest()
pw_hash_b64... | #!/usr/bin/env python3
import base64
import getpass
import hashlib
import json
import os
pw = getpass.getpass("enter your password: ")
pw_bytes = pw.encode("utf-8")
salt_bytes = os.urandom(8)
salt_b64 = base64.b64encode( salt_bytes )
pw_hash = hashlib.sha256( pw_bytes + salt_bytes ).digest()
pw_hash_b64... | fr | 0.221828 | #!/usr/bin/env python3 | 3.040607 | 3 |
shell/diskwalk_api.py | basicworld/studys | 0 | 6632583 | <filename>shell/diskwalk_api.py<gh_stars>0
#!/usr/bin/python
#coding:utf-8
#docs:this is a .sh with function similiar to 'tree'
import os
class diskwalk(object):
def __init__(self,path):
self.path=path
def enumeratepaths(self):
'''return the path to all the files in a directory'''
path_... | <filename>shell/diskwalk_api.py<gh_stars>0
#!/usr/bin/python
#coding:utf-8
#docs:this is a .sh with function similiar to 'tree'
import os
class diskwalk(object):
def __init__(self,path):
self.path=path
def enumeratepaths(self):
'''return the path to all the files in a directory'''
path_... | en | 0.659191 | #!/usr/bin/python #coding:utf-8 #docs:this is a .sh with function similiar to 'tree' return the path to all the files in a directory return all the files in a directory return all the directories in a directory | 3.277084 | 3 |
gedit/.local/share/gedit/plugins/pair_char_lang.py | bradleyfrank/dotfiles-archive | 0 | 6632584 | <gh_stars>0
# -*- coding: utf-8 -*-
#
# Programming language pair char support
#
# The default set is used if the language is not specified below. The plain
# set is used for plain text, or when the document has no specified language.
#
lang('default', '(){}[]""\'\'``')
lang('changelog', '(){}[]""<>')
lang('html', ... | # -*- coding: utf-8 -*-
#
# Programming language pair char support
#
# The default set is used if the language is not specified below. The plain
# set is used for plain text, or when the document has no specified language.
#
lang('default', '(){}[]""\'\'``')
lang('changelog', '(){}[]""<>')
lang('html', '(){}[... | en | 0.675991 | # -*- coding: utf-8 -*- # # Programming language pair char support # # The default set is used if the language is not specified below. The plain # set is used for plain text, or when the document has no specified language. # | 1.881187 | 2 |
ibis/tests/expr/test_interactive.py | kvemani/ibis | 0 | 6632585 | <gh_stars>0
# Copyright 2014 Cloudera Inc.
#
# 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... | # Copyright 2014 Cloudera Inc.
#
# 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, so... | en | 0.848738 | # Copyright 2014 Cloudera Inc. # # 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, so... | 1.548487 | 2 |
tnn/efficientgaternn.py | neuroailab/tnn | 88 | 6632586 | <gh_stars>10-100
import tensorflow as tf
from tensorflow.contrib.rnn import LSTMStateTuple
import tfutils.model
from tnn.cell import *
from tnn.main import _get_func_from_kwargs
try:
from tfutils.model import conv, depth_conv
except:
from tfutils.model_tool_old import conv, depth_conv
import copy
def ksize(val... | import tensorflow as tf
from tensorflow.contrib.rnn import LSTMStateTuple
import tfutils.model
from tnn.cell import *
from tnn.main import _get_func_from_kwargs
try:
from tfutils.model import conv, depth_conv
except:
from tfutils.model_tool_old import conv, depth_conv
import copy
def ksize(val):
if isinsta... | en | 0.654634 | Abstract object representing an Convolutional RNN cell. Run this RNN cell on inputs, starting from the given state. # "ConvRNNCell + self.scope# size(s) of state(s) used by this cell. Integer or TensorShape: size of outputs produced by this cell. Return zero-filled state tensor(s). Args: batch_size: int... | 2.587086 | 3 |
scripts/artifacts/sms.py | xperylabhub/iLEAPP | 0 | 6632587 | import os
import pandas as pd
import shutil
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly, sanitize_file_name
from scripts.chat_rendering import render_chat, chat_HTML
def get_sms(files_found, report_folder, s... | import os
import pandas as pd
import shutil
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly, sanitize_file_name
from scripts.chat_rendering import render_chat, chat_HTML
def get_sms(files_found, report_folder, s... | en | 0.323127 | SELECT CASE WHEN LENGTH(MESSAGE.DATE)=18 THEN DATETIME(MESSAGE.DATE/1000000000+978307200,'UNIXEPOCH') WHEN LENGTH(MESSAGE.DATE)=9 THEN DATETIME(MESSAGE.DATE + 978307200,'UNIXEPOCH') ELSE "N/A" END "MESSAGE DATE", MESSAGE.ROWID as "MESSAGE ID", CASE WHEN LENGTH(MESSAGE.DA... | 2.176243 | 2 |
python_ncurses/curse_2.py | Perceu/tiktok | 0 | 6632588 | import sys,os
import curses
from time import sleep
def animate(screen, desenho):
screen.clear()
desenho = open('./desenhos/batman.txt', 'r')
lines = desenho.readlines()
linha = len(lines)
coluna = 0
for l in lines[::-1]:
linha -= 1
coluna = 0
for c in l:
slee... | import sys,os
import curses
from time import sleep
def animate(screen, desenho):
screen.clear()
desenho = open('./desenhos/batman.txt', 'r')
lines = desenho.readlines()
linha = len(lines)
coluna = 0
for l in lines[::-1]:
linha -= 1
coluna = 0
for c in l:
slee... | en | 0.869539 | # Clear and refresh the screen for a blank canvas # Start colors in curses # Loop where k is the last character pressed # Wait for next input | 3.621543 | 4 |
src/apps/esv_dashboard/visualise_esvs.py | tomstark99/epic-kitchens-100-fyrp | 0 | 6632589 | <gh_stars>0
import argparse
import os
from pathlib import Path
import pandas as pd
import dash
from dash import Dash
from dash.exceptions import PreventUpdate
import flask
from apps.esv_dashboard.visualisation import Visualiser
from apps.esv_dashboard.visualisation_mf import VisualiserMF
from apps.esv_dashboard.resu... | import argparse
import os
from pathlib import Path
import pandas as pd
import dash
from dash import Dash
from dash.exceptions import PreventUpdate
import flask
from apps.esv_dashboard.visualisation import Visualiser
from apps.esv_dashboard.visualisation_mf import VisualiserMF
from apps.esv_dashboard.result import Re... | none | 1 | 2.321673 | 2 | |
hand.py | Devsharma431/Hand_Tracking | 0 | 6632590 | <gh_stars>0
import cv2
import mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
mp_hands = mp.solutions.hands
# For static images:
IMAGE_FILES = []
with mp_hands.Hands(
static_image_mode=True,
max_num_hands=2,
min_detection_confidence=0.5) as hands:
for idx, file in enumerate(IMAGE_FILES... | import cv2
import mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
mp_hands = mp.solutions.hands
# For static images:
IMAGE_FILES = []
with mp_hands.Hands(
static_image_mode=True,
max_num_hands=2,
min_detection_confidence=0.5) as hands:
for idx, file in enumerate(IMAGE_FILES):
# Re... | en | 0.785873 | # For static images: # Read an image, flip it around y-axis for correct handedness output (see # above). # Convert the BGR image to RGB before processing. # Print handedness and draw hand landmarks on the image. # For webcam input: # If loading a video, use 'break' instead of 'continue'. # Flip the image horizontally f... | 2.783354 | 3 |
301-400/392.is-subsequence.py | guangxu-li/leetcode-in-python | 0 | 6632591 | #
# @lc app=leetcode id=392 lang=python3
#
# [392] Is Subsequence
#
# @lc code=start
class Solution:
def isSubsequence(self, s: str, t: str) -> bool:
i, j = 0, 0
while i < len(s) and j < len(t):
if s[i] == t[j]:
i += 1
j += 1
return i == len(s)
# @lc ... | #
# @lc app=leetcode id=392 lang=python3
#
# [392] Is Subsequence
#
# @lc code=start
class Solution:
def isSubsequence(self, s: str, t: str) -> bool:
i, j = 0, 0
while i < len(s) and j < len(t):
if s[i] == t[j]:
i += 1
j += 1
return i == len(s)
# @lc ... | en | 0.546223 | # # @lc app=leetcode id=392 lang=python3 # # [392] Is Subsequence # # @lc code=start # @lc code=end | 3.060883 | 3 |
python/pyspark/daemon.py | xieyuchen/spark | 79 | 6632592 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | en | 0.880666 | # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us... | 1.818976 | 2 |
ex02-mdps/ex02-mdps.py | christianreiser/reinforcement-learning-course-uni-stuttgart | 0 | 6632593 | <reponame>christianreiser/reinforcement-learning-course-uni-stuttgart
import gym
import numpy as np
# Init environment
# Lets use a smaller 3x3 custom map for faster computations
custom_map3x3 = [
'SFF',
'FFF',
'FHG',
]
# env = gym.make("FrozenLake-v0", desc=custom_map3x3)
# TODO: Uncomment the following ... | import gym
import numpy as np
# Init environment
# Lets use a smaller 3x3 custom map for faster computations
custom_map3x3 = [
'SFF',
'FFF',
'FHG',
]
# env = gym.make("FrozenLake-v0", desc=custom_map3x3)
# TODO: Uncomment the following line to try the default map (4x4):
env = gym.make("FrozenLake-v0")
# ... | en | 0.709468 | # Init environment # Lets use a smaller 3x3 custom map for faster computations # env = gym.make("FrozenLake-v0", desc=custom_map3x3) # TODO: Uncomment the following line to try the default map (4x4): # Uncomment the following lines for even larger maps: # random_map = generate_random_map(size=5, p=0.8) # env = gym.make... | 2.962636 | 3 |
py_server/db_ctrl.py | Makoto-hr-jp/makoto-site | 0 | 6632594 | '''
Autor: TM
Svrha: upravljanje bazom podataka
'''
#built-in
from hashlib import sha256
from datetime import datetime
# addons
import mysql.connector as sql
# internal
import db_config
from log import log_msg
forbidden=["SELECT","FROM","DELETE","INSERT"]
def connect():
global dbconn
log_msg('INFO','Connec... | '''
Autor: TM
Svrha: upravljanje bazom podataka
'''
#built-in
from hashlib import sha256
from datetime import datetime
# addons
import mysql.connector as sql
# internal
import db_config
from log import log_msg
forbidden=["SELECT","FROM","DELETE","INSERT"]
def connect():
global dbconn
log_msg('INFO','Connec... | en | 0.146509 | Autor: TM Svrha: upravljanje bazom podataka #built-in # addons # internal VALUES ("{ID}", "{date}", {data['gradivo']}, {data['listic']}, {data['zadaca']}, "{data['komentar']}") # database init | 2.313505 | 2 |
tests/test_parser.py | AndrewAnnex/pvl | 0 | 6632595 | #!/usr/bin/env python
"""This module has new tests for the pvl decoder functions."""
# Copyright 2019, <NAME> (<EMAIL>)
#
# 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.apa... | #!/usr/bin/env python
"""This module has new tests for the pvl decoder functions."""
# Copyright 2019, <NAME> (<EMAIL>)
#
# 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.apa... | en | 0.596331 | #!/usr/bin/env python This module has new tests for the pvl decoder functions. # Copyright 2019, <NAME> (<EMAIL>) # # 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... | 2.406891 | 2 |
delta/data/task/text_seq_label_task_test.py | didichuxing/delta | 1,442 | 6632596 | # Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | # Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | en | 0.773585 | # Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI... | 1.603457 | 2 |
brfast/measures/sensitivity/fpselect.py | tandriamil/BrFAST | 6 | 6632597 | <reponame>tandriamil/BrFAST
#!/usr/bin/python3
"""Module containing the sensitivity measures used in the FPSelect paper."""
import importlib
from typing import List
from loguru import logger
from brfast.data.attribute import AttributeSet
from brfast.data.dataset import FingerprintDataset
from brfast.measures import ... | #!/usr/bin/python3
"""Module containing the sensitivity measures used in the FPSelect paper."""
import importlib
from typing import List
from loguru import logger
from brfast.data.attribute import AttributeSet
from brfast.data.dataset import FingerprintDataset
from brfast.measures import SensitivityMeasure
# from me... | en | 0.770538 | #!/usr/bin/python3 Module containing the sensitivity measures used in the FPSelect paper. # from measures.similarity import TODO # Import the engine of the analysis module (pandas or modin) Get a DataFrame with the k-most common fingerprints. Args: dataframe: The fingerprint dataset. attribute_name... | 2.553569 | 3 |
_352_scrape.py | bansallab/roundup | 0 | 6632598 | import csv
import re
from urllib.request import Request, urlopen
from dateutil import parser
from sys import argv
from bs4 import BeautifulSoup
import scrape_util
default_sale, base_url, prefix = scrape_util.get_market(argv)
report_path = 'main/actual_sales.idc.htm'
def get_sale_date(tag):
"""Return the date of... | import csv
import re
from urllib.request import Request, urlopen
from dateutil import parser
from sys import argv
from bs4 import BeautifulSoup
import scrape_util
default_sale, base_url, prefix = scrape_util.get_market(argv)
report_path = 'main/actual_sales.idc.htm'
def get_sale_date(tag):
"""Return the date of... | en | 0.746337 | Return the date of the livestock sale. # locate existing CSV files # download Saturday sale page # Stop iteration if this report is already archived # Initialize the default sale dictionary # open a new CSV file and write each sale | 3.095248 | 3 |
selfdrive/mapd/lib/osm.py | arneschwarck/openpilot | 4 | 6632599 | <reponame>arneschwarck/openpilot<gh_stars>1-10
import overpy
class OSM():
def __init__(self):
self.api = overpy.Overpass()
def fetch_road_ways_around_location(self, location, radius):
lat, lon = location
# fetch all ways and nodes on this ways around location
around_str = f'{str(radius)},{... | import overpy
class OSM():
def __init__(self):
self.api = overpy.Overpass()
def fetch_road_ways_around_location(self, location, radius):
lat, lon = location
# fetch all ways and nodes on this ways around location
around_str = f'{str(radius)},{str(lat)},{str(lon)}'
q = """
w... | en | 0.786186 | # fetch all ways and nodes on this ways around location way(around: ) [highway] [highway!~"^(footway|path|bridleway|steps|cycleway|construction|bus_guideway|escape|service)$"]; (._;>;); out; | 3.089963 | 3 |
dcm/cli.py | moloney/dcm | 11 | 6632600 | """Command line interface"""
from __future__ import annotations
import sys, os, logging, json, re
import asyncio
from contextlib import ExitStack
from copy import deepcopy
from datetime import datetime
from typing import Optional, Callable, Awaitable
import pydicom
from pydicom.dataset import Dataset
from pydicom.data... | """Command line interface"""
from __future__ import annotations
import sys, os, logging, json, re
import asyncio
from contextlib import ExitStack
from copy import deepcopy
from datetime import datetime
from typing import Optional, Callable, Awaitable
import pydicom
from pydicom.dataset import Dataset
from pydicom.data... | en | 0.760044 | Command line interface Print msg to stderr and exit with non-zero exit code High level DICOM file and network operations # Create Rich Console outputing to stderr for logging / progress bars # Setup logging # logging.getLogger("asyncio").setLevel(logging.DEBUG) # Create global param dict for subcommands to use Print th... | 1.847126 | 2 |
ipysheet/_version.py | DougRzz/ipysheet | 0 | 6632601 | __version_tuple__ = (0, 3, 0)
__version_tuple_js__ = (0, 3, 1)
__version__ = '0.3.0'
__version_js__ = '0.3.1'
version_info = __version_tuple__ # kept for backward compatibility
| __version_tuple__ = (0, 3, 0)
__version_tuple_js__ = (0, 3, 1)
__version__ = '0.3.0'
__version_js__ = '0.3.1'
version_info = __version_tuple__ # kept for backward compatibility
| en | 0.820226 | # kept for backward compatibility | 1.327737 | 1 |
tools/download_imagenet_weights.py | jinlmsft/Detectron.pytorch | 0 | 6632602 | <reponame>jinlmsft/Detectron.pytorch
"""Script to downlaod ImageNet pretrained weights from Google Drive
Extra packages required to run the script:
colorama, argparse_color_formatter
"""
import argparse
import os
import requests
#from argparse_color_formatter import ColorHelpFormatter
#from colorama import init, ... | """Script to downlaod ImageNet pretrained weights from Google Drive
Extra packages required to run the script:
colorama, argparse_color_formatter
"""
import argparse
import os
import requests
#from argparse_color_formatter import ColorHelpFormatter
#from colorama import init, Fore
import _init_paths # pylint: d... | en | 0.348289 | Script to downlaod ImageNet pretrained weights from Google Drive Extra packages required to run the script: colorama, argparse_color_formatter #from argparse_color_formatter import ColorHelpFormatter #from colorama import init, Fore # pylint: disable=unused-import Parser command line argumnets #(formatter_class=Co... | 2.421883 | 2 |
vehicle_control/3_control/testing.py | tekjar/fcnd.projects | 0 | 6632603 | <filename>vehicle_control/3_control/testing.py
from controllers import PController, PDController, PIDController
def close_enough_floats(f1, f2):
return abs(f1 - f2) < 0.0001
def pct_diff(f, f_expected):
return 100.0 * (f - f_expected) / f_expected
def p_controller_test(StudentPC):
k_p = 1.5
m = 2.... | <filename>vehicle_control/3_control/testing.py
from controllers import PController, PDController, PIDController
def close_enough_floats(f1, f2):
return abs(f1 - f2) < 0.0001
def pct_diff(f, f_expected):
return 100.0 * (f - f_expected) / f_expected
def p_controller_test(StudentPC):
k_p = 1.5
m = 2.... | none | 1 | 2.74602 | 3 | |
commands/SinterBoxCommand/entry.py | tapnair/SinterBox | 0 | 6632604 | # Copyright 2022 by Autodesk, Inc.
# Permission to use, copy, modify, and distribute this software in object code form
# for any purpose and without fee is hereby granted, provided that the above copyright
# notice appears in all copies and that both that copyright notice and the limited
# warranty and restricted ... | # Copyright 2022 by Autodesk, Inc.
# Permission to use, copy, modify, and distribute this software in object code form
# for any purpose and without fee is hereby granted, provided that the above copyright
# notice appears in all copies and that both that copyright notice and the limited
# warranty and restricted ... | en | 0.728097 | # Copyright 2022 by Autodesk, Inc. # Permission to use, copy, modify, and distribute this software in object code form # for any purpose and without fee is hereby granted, provided that the above copyright # notice appears in all copies and that both that copyright notice and the limited # warranty and restricted ... | 1.647796 | 2 |
qf_diamond_norm/info_test.py | gecrooks/qf-diamond-norm | 1 | 6632605 | # Copyright 2020-, <NAME> and contributors
#
# This source code is licensed under the Apache License 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
import numpy as np
import pytest
import quantumflow as qf
from qf_diamond_norm import diamond_norm
def test_diamond_norm() -> None:
... | # Copyright 2020-, <NAME> and contributors
#
# This source code is licensed under the Apache License 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
import numpy as np
import pytest
import quantumflow as qf
from qf_diamond_norm import diamond_norm
def test_diamond_norm() -> None:
... | en | 0.836755 | # Copyright 2020-, <NAME> and contributors # # This source code is licensed under the Apache License 2.0 found in # the LICENSE.txt file in the root directory of this source tree. # Test cases borrowed from qutip, # https://github.com/qutip/qutip/blob/master/qutip/tests/test_metrics.py # which were in turn generated u... | 1.859883 | 2 |
.history/ClassFiles/Control Flow/ForLoopRangeFunc_20210101223259.py | minefarmer/Comprehensive-Python | 0 | 6632606 | ''' Range Function
range( )
''' | ''' Range Function
range( )
''' | en | 0.324508 | Range Function range( ) | 1.201315 | 1 |
exportCellPopExcel.py | msw1293/HDF5-data-Mining | 0 | 6632607 | <filename>exportCellPopExcel.py
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 04 09:31:26 2018
@author: lfuchshofen
"""
#This Script will Demonstrate Pulling Data for a Single Cell
#Using the loadHDF5 tool.
#Import packages and loadHDF5 custom script
import numpy as np
import loadHDF5
import matplotlib... | <filename>exportCellPopExcel.py
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 04 09:31:26 2018
@author: lfuchshofen
"""
#This Script will Demonstrate Pulling Data for a Single Cell
#Using the loadHDF5 tool.
#Import packages and loadHDF5 custom script
import numpy as np
import loadHDF5
import matplotlib... | en | 0.746589 | # -*- coding: utf-8 -*- Created on Thu Jan 04 09:31:26 2018
@author: lfuchshofen #This Script will Demonstrate Pulling Data for a Single Cell #Using the loadHDF5 tool. #Import packages and loadHDF5 custom script #Define cystom "CellObj" object to store data #Define a group of cells #Define empty list to populate #Ge... | 2.519598 | 3 |
external/config.simple.py | eeyes-fsd/gymnasium-2019-11 | 0 | 6632608 | <gh_stars>0
class Config:
redis = {
'host': '127.0.0.1',
'port': '6379',
'password': <PASSWORD>,
'db': 0
}
app = {
'name': 'laravel_database_gym',
'tag': 'swap'
}
conf = Config()
| class Config:
redis = {
'host': '127.0.0.1',
'port': '6379',
'password': <PASSWORD>,
'db': 0
}
app = {
'name': 'laravel_database_gym',
'tag': 'swap'
}
conf = Config() | none | 1 | 1.616571 | 2 | |
landlab/grid/tests/test_raster_grid/test_has_boundary_neighbor.py | awickert/landlab | 1 | 6632609 | import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import with_setup, assert_true, assert_false
try:
from nose.tools import assert_tuple_equal
except ImportError:
from landlab.testing.tools import assert_tuple_equal
from landlab import RasterModelGrid
def setup_grid():
global... | import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import with_setup, assert_true, assert_false
try:
from nose.tools import assert_tuple_equal
except ImportError:
from landlab.testing.tools import assert_tuple_equal
from landlab import RasterModelGrid
def setup_grid():
global... | none | 1 | 2.26941 | 2 | |
renderButton.py | tsmaster/RayMarcher | 0 | 6632610 | <reponame>tsmaster/RayMarcher<gh_stars>0
import os
import math
import bdgmath
import camera
import scene
import plane
import sphere
import cylinder
import donut
import box
import repeated2d
import transform
import light
import material
import csg
import roundedge
cam = camera.FreeCamera(bdgmath.Vector3(5, -8, 6),
... | import os
import math
import bdgmath
import camera
import scene
import plane
import sphere
import cylinder
import donut
import box
import repeated2d
import transform
import light
import material
import csg
import roundedge
cam = camera.FreeCamera(bdgmath.Vector3(5, -8, 6),
bdgmath.Vector3(0,... | ko | 0.157037 | #scene.addObject(translatedDisk) #cam.renderScene(scene, 640, 320, "raytest.png", 5) #cam.renderScene(scene, 300, 240, "raytest.png", 5) | 2.133129 | 2 |
elifinokuzu/dictionary/apps.py | omerumur14/elifin-okuzu | 2 | 6632611 | from django.apps import AppConfig
class DictionaryConfig(AppConfig):
name = 'dictionary'
| from django.apps import AppConfig
class DictionaryConfig(AppConfig):
name = 'dictionary'
| none | 1 | 1.255409 | 1 | |
predict/predict.py | hirune924/kaggle-SETI-2ndPlaceSolution | 0 | 6632612 | <reponame>hirune924/kaggle-SETI-2ndPlaceSolution
####################
# Import Libraries
####################
import os
import sys
from PIL import Image
import cv2
import numpy as np
import pandas as pd
import pytorch_lightning as pl
from pytorch_lightning.metrics import Accuracy
from pytorch_lightning import loggers
... | ####################
# Import Libraries
####################
import os
import sys
from PIL import Image
import cv2
import numpy as np
import pandas as pd
import pytorch_lightning as pl
from pytorch_lightning.metrics import Accuracy
from pytorch_lightning import loggers
from pytorch_lightning import seed_everything
fro... | en | 0.371055 | #################### # Import Libraries #################### #################### # Utils #################### # remove `model.` Rotate a tensor image or a batch of tensor images 180 degrees. Input must be a tensor of shape (C, H, W) or a batch of tensors :math:`(*, C, H, W)`. Args: input (torch.Ten... | 2.121084 | 2 |
ros_ws/src/baxter_examples/scripts/ik_service_client.py | mesneym/Baxter-Arm-PP | 0 | 6632613 | <filename>ros_ws/src/baxter_examples/scripts/ik_service_client.py<gh_stars>0
version https://git-lfs.github.com/spec/v1
oid sha256:75d6721557de605e8ed3657e3ec24e2276bdcbae6bda0ead4ad8282ad183e806
size 5347
| <filename>ros_ws/src/baxter_examples/scripts/ik_service_client.py<gh_stars>0
version https://git-lfs.github.com/spec/v1
oid sha256:75d6721557de605e8ed3657e3ec24e2276bdcbae6bda0ead4ad8282ad183e806
size 5347
| none | 1 | 1.234999 | 1 | |
tree.py | hmble/tree | 0 | 6632614 | <filename>tree.py<gh_stars>0
import os
import sys
from collections import OrderedDict
class Tree:
def __init__(self):
self.dircount = 0
self.filecount = 0
self.dict_dir = []
self.dict_file = []
self.ignore = [".git", "AW_Dribble"]
def walk(self, path, prefix=""):
... | <filename>tree.py<gh_stars>0
import os
import sys
from collections import OrderedDict
class Tree:
def __init__(self):
self.dircount = 0
self.filecount = 0
self.dict_dir = []
self.dict_file = []
self.ignore = [".git", "AW_Dribble"]
def walk(self, path, prefix=""):
... | en | 0.615855 | # FIXME : # when arguments passed with / at end `os.path.basename(path) # prints nothings as basename is an empty string e.g. home/dir/ # # TODO : Options to follow symlinks or not # Currently no method for symlinks # tree.walk(directory) #print("\ndirectories " + str(tree.dircount) + ", files " + str(tree.filecount)) | 2.943474 | 3 |
neutron/extensions/flavors.py | glove747/liberty-neutron | 0 | 6632615 | # 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 required by applicable law or agreed to in... | # 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 required by applicable law or agreed to in... | en | 0.793099 | # 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 required by applicable law or agreed to in... | 1.246742 | 1 |
30_Information_Retrieval/project/src/Inverted_Index/Lib/dataProcess_BySpark.py | Xinrihui/Data-Structure-and-Algrithms | 1 | 6632616 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
from collections import *
from numpy import *
import re
import json
from pyspark.sql import SparkSession
from functools import reduce
class Test:
def test1(self):
"""
不可见字符 的 打印 和 写入文本
:return:
"""
SOH=chr(0x01)... | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
from collections import *
from numpy import *
import re
import json
from pyspark.sql import SparkSession
from functools import reduce
class Test:
def test1(self):
"""
不可见字符 的 打印 和 写入文本
:return:
"""
SOH=chr(0x01)... | zh | 0.873465 | #!/usr/bin/python # -*- coding: UTF-8 -*- 不可见字符 的 打印 和 写入文本 :return: # SOH # 换行键(LF) # print(next_line_char) # 根本看不到 ; 只能写到文本 中使用 notepad++ 查看 # 直接从文本 中 粘SOH 过来 # 输出 ASCII 码 为 1 # 换行符 不能直接从文本 粘贴过来,这样直接在 IDE中就换行了 # # 指向 切片文件的 首位 by XRH date: 2020-06-14 利用 spark 做数据 处理 功能: 1.对 临时索引文件 tmp_... | 2.778204 | 3 |
tripleo_ansible/ansible_plugins/modules/tripleo_container_config_scripts.py | beagles/tripleo-ansible | 22 | 6632617 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2020 Red Hat, 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/lice... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2020 Red Hat, 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/lice... | en | 0.684911 | #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2020 Red Hat, 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/lice... | 2.032669 | 2 |
rastercube/io.py | terrai/rastercube | 16 | 6632618 | """
IO helper functions that transparently deal with both loca files (fs://) and
HDFS files (hdfs://)
"""
import os
import shutil
import numpy as np
import rastercube.utils as utils
import rastercube.hadoop.common as terrahdfs
def strip_uri_proto(uri, proto):
"""
Remove the protocol prefix in a URI. Turns
... | """
IO helper functions that transparently deal with both loca files (fs://) and
HDFS files (hdfs://)
"""
import os
import shutil
import numpy as np
import rastercube.utils as utils
import rastercube.hadoop.common as terrahdfs
def strip_uri_proto(uri, proto):
"""
Remove the protocol prefix in a URI. Turns
... | en | 0.819081 | IO helper functions that transparently deal with both loca files (fs://) and HDFS files (hdfs://) Remove the protocol prefix in a URI. Turns fs:///foo/bar into /foo/bar Write to local fs or HDFS based on fname uri # When writing fractions to HDFS, we might want to adapt the # blocksize to match the ... | 2.484745 | 2 |
maya/custom_nodes_python/retargetSolver/CapsuleLink.py | JeromeEippers/python_rnd_collection | 0 | 6632619 | <reponame>JeromeEippers/python_rnd_collection
import mtypes as t
class CapsuleLink(object):
def __init__(self, distance, ratioA, ratioB, normalA, normalB, relativePq):
self.distance = distance
self.ratioA = ratioA
self.ratioB = ratioB
self.normalA = normalA
self.normalB = ... | import mtypes as t
class CapsuleLink(object):
def __init__(self, distance, ratioA, ratioB, normalA, normalB, relativePq):
self.distance = distance
self.ratioA = ratioA
self.ratioB = ratioB
self.normalA = normalA
self.normalB = normalB
self.relativePq = relativePq
... | en | 0.854876 | CapsuleLink( distance={}, ratioA={}, ratioB={}, normalA={}, normalB={}, relativePq={} ) #compute the target pq #compute how we will move capsuleB so B matches the target #if the ratio is not 1.0 we will move B a little then compute the mo... | 2.569821 | 3 |
rest.py | zoomdbz/rest | 0 | 6632620 | <filename>rest.py
#!/usr/bin/env python3
#MIT License
#Copyright (C) 2019 <EMAIL>
#https://github.com/plasticuproject/rest
#Thanks to mikesz81 for concept and nbulischeck for code review
#linpeas.sh script added by Dividesbyzer0
from termcolor import cprint
import subprocess
import paramiko
import argparse
import pa... | <filename>rest.py
#!/usr/bin/env python3
#MIT License
#Copyright (C) 2019 <EMAIL>
#https://github.com/plasticuproject/rest
#Thanks to mikesz81 for concept and nbulischeck for code review
#linpeas.sh script added by Dividesbyzer0
from termcolor import cprint
import subprocess
import paramiko
import argparse
import pa... | en | 0.790029 | #!/usr/bin/env python3 #MIT License #Copyright (C) 2019 <EMAIL> #https://github.com/plasticuproject/rest #Thanks to mikesz81 for concept and nbulischeck for code review #linpeas.sh script added by Dividesbyzer0 #print tool information # parse arguments # checks if searchsploit is installed # downloads list of installed... | 1.800968 | 2 |
q_network.py | timokau/task-placement | 1 | 6632621 | <gh_stars>1-10
# EncodeProcessDecode model is based on the graph_nets demo
# https://github.com/deepmind/graph_nets/blob/6f33ee4244ebe016b4d6296dd3eb99625fd9f3af/graph_nets/demos/models.py
"""Graph Q-Network"""
from functools import partial
from graph_nets import modules
from graph_nets import utils_tf
import sonnet ... | # EncodeProcessDecode model is based on the graph_nets demo
# https://github.com/deepmind/graph_nets/blob/6f33ee4244ebe016b4d6296dd3eb99625fd9f3af/graph_nets/demos/models.py
"""Graph Q-Network"""
from functools import partial
from graph_nets import modules
from graph_nets import utils_tf
import sonnet as snt
import t... | en | 0.772672 | # EncodeProcessDecode model is based on the graph_nets demo # https://github.com/deepmind/graph_nets/blob/6f33ee4244ebe016b4d6296dd3eb99625fd9f3af/graph_nets/demos/models.py Graph Q-Network # The abstract sonnet _build function has a (*args, **kwargs) argument # list, so we can pass whatever we want. # pylint: disable=... | 2.495373 | 2 |
display.py | egurnick/Sorting-Algorithms-Visualizer | 0 | 6632622 | <filename>display.py<gh_stars>0
import pygame
from sys import exit
from math import ceil
# Initialize pygame modules
pygame.init()
# Display settings
windowSize = (900, 500)
screen = pygame.display.set_mode(windowSize)
pygame.display.set_caption('Sorting Algorithms Visualizer')
# Font
baseFont = pygame.... | <filename>display.py<gh_stars>0
import pygame
from sys import exit
from math import ceil
# Initialize pygame modules
pygame.init()
# Display settings
windowSize = (900, 500)
screen = pygame.display.set_mode(windowSize)
pygame.display.set_caption('Sorting Algorithms Visualizer')
# Font
baseFont = pygame.... | en | 0.609971 | # Initialize pygame modules # Display settings # Font # Used Colors # Draw the label # Draw the rect button # Draw central line # Draw bar control # Input Boxes # Button # Global Variables Draw the bars and control their colors Draw the menu below the bars Draw all the interface | 2.97669 | 3 |
arbol-ordinales-jp.py | andresvillamayor/Ejemplos_ML | 0 | 6632623 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 9 09:23:19 2020
Arbol de Desiciones
@author: andyvillamayor
"""
#El calulo del arbol esta hecho automaticamente por DecisionTreeClassifier
#Parametros = entropia valor maximo de desglose = 6
#librerias
import pandas as pd
import numpy as np
from s... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 9 09:23:19 2020
Arbol de Desiciones
@author: andyvillamayor
"""
#El calulo del arbol esta hecho automaticamente por DecisionTreeClassifier
#Parametros = entropia valor maximo de desglose = 6
#librerias
import pandas as pd
import numpy as np
from s... | es | 0.745231 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Sat Jun 9 09:23:19 2020 Arbol de Desiciones @author: andyvillamayor #El calulo del arbol esta hecho automaticamente por DecisionTreeClassifier #Parametros = entropia valor maximo de desglose = 6 #librerias #lectura de datos #verificacion de los datos #validacio... | 3.030308 | 3 |
test/optimizer/test_jsonscan.py | robes/chisel | 1 | 6632624 | """Unit tests for the JSONDataExtant operator.
"""
import unittest
import deriva.chisel.optimizer as _opt
payload = [
{
'RID': 1,
'property_1': 'hello'
},
{
'RID': 2,
'property_1': 'world'
}
]
class TestJSONScan (unittest.TestCase):
"""Basic tests for JSONDataExtan... | """Unit tests for the JSONDataExtant operator.
"""
import unittest
import deriva.chisel.optimizer as _opt
payload = [
{
'RID': 1,
'property_1': 'hello'
},
{
'RID': 2,
'property_1': 'world'
}
]
class TestJSONScan (unittest.TestCase):
"""Basic tests for JSONDataExtan... | en | 0.711233 | Unit tests for the JSONDataExtant operator. Basic tests for JSONDataExtant operator. | 3.013136 | 3 |
evdev/eventio.py | alexbprofit/python-evdev | 231 | 6632625 | <gh_stars>100-1000
# encoding: utf-8
import os
import fcntl
import select
import functools
from evdev import _input, _uinput, ecodes, util
from evdev.events import InputEvent
#--------------------------------------------------------------------------
class EvdevError(Exception):
pass
class EventIO(object):
... | # encoding: utf-8
import os
import fcntl
import select
import functools
from evdev import _input, _uinput, ecodes, util
from evdev.events import InputEvent
#--------------------------------------------------------------------------
class EvdevError(Exception):
pass
class EventIO(object):
'''
Base class... | en | 0.683059 | # encoding: utf-8 #-------------------------------------------------------------------------- Base class for reading and writing input events. This class is used by :class:`InputDevice` and :class:`UInput`. - On, :class:`InputDevice` it used for reading user-generated events (e.g. key presses, mouse mov... | 2.635843 | 3 |
azure-mgmt-redis/azure/mgmt/redis/models/redis_reboot_parameters.py | CharaD7/azure-sdk-for-python | 0 | 6632626 | <filename>azure-mgmt-redis/azure/mgmt/redis/models/redis_reboot_parameters.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license inform... | <filename>azure-mgmt-redis/azure/mgmt/redis/models/redis_reboot_parameters.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license inform... | en | 0.532538 | # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ... | 2.040643 | 2 |
naeval/syntax/models/slovnet.py | sdspieg/naeval | 36 | 6632627 | <filename>naeval/syntax/models/slovnet.py
from naeval.const import SLOVNET, SLOVNET_BERT
from naeval.chop import chop
from ..markup import Token, Markup
from .base import post, ChunkModel
SLOVNET_CONTAINER_PORT = 8080
SLOVNET_IMAGE = 'natasha/slovnet-morph'
SLOVNET_BERT_IMAGE = 'natasha/slovnet-syntax-bert'
SLOVNE... | <filename>naeval/syntax/models/slovnet.py
from naeval.const import SLOVNET, SLOVNET_BERT
from naeval.chop import chop
from ..markup import Token, Markup
from .base import post, ChunkModel
SLOVNET_CONTAINER_PORT = 8080
SLOVNET_IMAGE = 'natasha/slovnet-morph'
SLOVNET_BERT_IMAGE = 'natasha/slovnet-syntax-bert'
SLOVNE... | none | 1 | 2.363212 | 2 | |
src/tests/test_consumer.py | jankatins/python-kafka-postgresql-project | 2 | 6632628 | <filename>src/tests/test_consumer.py
import pytest
from unittest.mock import MagicMock, Mock
import checkweb.consumer
import checkweb.check_event
def test_handle_event_dict():
# based on https://stackoverflow.com/questions/28850070/python-mocking-a-context-manager
# and a lot of trial and error...
pg_cu... | <filename>src/tests/test_consumer.py
import pytest
from unittest.mock import MagicMock, Mock
import checkweb.consumer
import checkweb.check_event
def test_handle_event_dict():
# based on https://stackoverflow.com/questions/28850070/python-mocking-a-context-manager
# and a lot of trial and error...
pg_cu... | en | 0.876287 | # based on https://stackoverflow.com/questions/28850070/python-mocking-a-context-manager # and a lot of trial and error... # based on https://stackoverflow.com/questions/28850070/python-mocking-a-context-manager # and a lot of trial and error... # the last migration, so needs adjustments with every new one | 2.41958 | 2 |
leetcode/M0714_Best_Time_to_Buy_and_Sell_Stock_with_Transaction_Fee.py | jjmoo/daily | 1 | 6632629 | class Solution(object):
def maxProfit(self, prices, fee):
"""
:type prices: List[int]
:type fee: int
:rtype: int
"""
if not prices:
return 0
sold, keep = 0, -1<<31
for price in prices:
last_sold = sold
sold = max(sol... | class Solution(object):
def maxProfit(self, prices, fee):
"""
:type prices: List[int]
:type fee: int
:rtype: int
"""
if not prices:
return 0
sold, keep = 0, -1<<31
for price in prices:
last_sold = sold
sold = max(sol... | en | 0.853912 | :type prices: List[int] :type fee: int :rtype: int # Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer fee representing a transaction fee. # You may complete as many transactions as you like, but you need to pay the ... | 3.673709 | 4 |
lasto3dtiles/__init__.py | colspan/las-to-3d-tiles | 2 | 6632630 | <gh_stars>1-10
import lasto3dtiles.format
import lasto3dtiles.task
import lasto3dtiles.util
| import lasto3dtiles.format
import lasto3dtiles.task
import lasto3dtiles.util | none | 1 | 1.023813 | 1 | |
portals/wwits/groups/service/wo_update_site_addr/models.py | jalanb/portals | 0 | 6632631 | <filename>portals/wwits/groups/service/wo_update_site_addr/models.py
from dataclasses import dataclass
@dataclass
class ParmModel:
UserID: str
Version: str
Env: str
Source: str
Session: int
OrderNum: str
Street: str
City: str
State: str
Zip: str
Country: str
CompanyName... | <filename>portals/wwits/groups/service/wo_update_site_addr/models.py
from dataclasses import dataclass
@dataclass
class ParmModel:
UserID: str
Version: str
Env: str
Source: str
Session: int
OrderNum: str
Street: str
City: str
State: str
Zip: str
Country: str
CompanyName... | none | 1 | 1.836916 | 2 | |
ITcoach/DataAnalysis-master/day02/code/page48.py | ww35133634/chenxusheng | 0 | 6632632 | <gh_stars>0
# coding=utf-8
from matplotlib import pyplot as plt
from matplotlib import font_manager
interval = [0,5,10,15,20,25,30,35,40,45,60,90]
width = [5,5,5,5,5,5,5,5,5,15,30,60]
quantity = [836,2737,3723,3926,3596,1438,3273,642,824,613,215,47]
print(len(interval),len(width),len(quantity))
#设置图形大小
plt.figure(f... | # coding=utf-8
from matplotlib import pyplot as plt
from matplotlib import font_manager
interval = [0,5,10,15,20,25,30,35,40,45,60,90]
width = [5,5,5,5,5,5,5,5,5,15,30,60]
quantity = [836,2737,3723,3926,3596,1438,3273,642,824,613,215,47]
print(len(interval),len(width),len(quantity))
#设置图形大小
plt.figure(figsize=(20,8... | zh | 0.851315 | # coding=utf-8 #设置图形大小 #设置x轴的刻度 | 2.998125 | 3 |
measurepace/urls.py | kodecharlie/PeerPace | 0 | 6632633 | <filename>measurepace/urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^parameterize-performance-calculation/$', views.parameterize_performance_calculation, name='parameterize-performance-calculation'),
url(r'^identify-project$', vie... | <filename>measurepace/urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^parameterize-performance-calculation/$', views.parameterize_performance_calculation, name='parameterize-performance-calculation'),
url(r'^identify-project$', vie... | none | 1 | 1.711774 | 2 | |
project/app/models/partner.py | rvaccari/sbgo | 0 | 6632634 | <filename>project/app/models/partner.py
from tortoise import fields
from app.models.base import BaseModel
class Partner(BaseModel):
partner_id = fields.CharField(max_length=255, unique=True)
name = fields.CharField(max_length=255)
| <filename>project/app/models/partner.py
from tortoise import fields
from app.models.base import BaseModel
class Partner(BaseModel):
partner_id = fields.CharField(max_length=255, unique=True)
name = fields.CharField(max_length=255)
| none | 1 | 2.433456 | 2 | |
parsifal/activities/urls.py | michelav/parsifal | 1 | 6632635 | # coding: utf-8
from django.conf.urls import patterns, include, url
urlpatterns = patterns('parsifal.activities.views',
url(r'^follow/$', 'follow', name='follow'),
url(r'^unfollow/$', 'unfollow', name='unfollow'),
url(r'^update_followers_count/$', 'update_followers_count', name='update_followers_count'),
) | # coding: utf-8
from django.conf.urls import patterns, include, url
urlpatterns = patterns('parsifal.activities.views',
url(r'^follow/$', 'follow', name='follow'),
url(r'^unfollow/$', 'unfollow', name='unfollow'),
url(r'^update_followers_count/$', 'update_followers_count', name='update_followers_count'),
) | en | 0.833554 | # coding: utf-8 | 1.600509 | 2 |
mixins/models.py | rigelk/magiciendose | 2 | 6632636 | <reponame>rigelk/magiciendose<filename>mixins/models.py
from django.db import models
from pgeocode import Nominatim
nomi = Nominatim('fr')
class GeoCodeMixin(models.Model):
code_postal = models.PositiveSmallIntegerField(null=True)
code_commune_insee = models.PositiveSmallIntegerField(null=True)
@propert... | from django.db import models
from pgeocode import Nominatim
nomi = Nominatim('fr')
class GeoCodeMixin(models.Model):
code_postal = models.PositiveSmallIntegerField(null=True)
code_commune_insee = models.PositiveSmallIntegerField(null=True)
@property
def departement(self):
return nomi.query_p... | none | 1 | 2.261224 | 2 | |
plugins/ctags_generator/ctags_generator.py | mohnjahoney/website_source | 13 | 6632637 | <filename>plugins/ctags_generator/ctags_generator.py<gh_stars>10-100
# -*- coding: utf-8 -*-
import os
from pelican import signals
CTAGS_TEMPLATE = """{% for tag, articles in tags_articles %}
{% for article in articles %}
{{tag}}\t{{article}}\t0;"\ttag
{% endfor %}
{% endfor %}
"""
def generate_ctags(article_gene... | <filename>plugins/ctags_generator/ctags_generator.py<gh_stars>10-100
# -*- coding: utf-8 -*-
import os
from pelican import signals
CTAGS_TEMPLATE = """{% for tag, articles in tags_articles %}
{% for article in articles %}
{{tag}}\t{{article}}\t0;"\ttag
{% endfor %}
{% endfor %}
"""
def generate_ctags(article_gene... | en | 0.31957 | # -*- coding: utf-8 -*- {% for tag, articles in tags_articles %} {% for article in articles %} {{tag}}\t{{article}}\t0;"\ttag {% endfor %} {% endfor %} | 2.2634 | 2 |
FPS/Libraries/mynodes/logicnode_definitions/value_seperate_quat.py | Simonrazer/ArmoryProjects | 1 | 6632638 | import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class SeparateQuatNode(Node, ArmLogicTreeNode):
'''SeparateQuatNode'''
bl_idname = 'LNSeparateQuatNode'
bl_label = 'Separate Quat'
bl_icon = 'QUESTION'
def init(self, context):
s... | import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class SeparateQuatNode(Node, ArmLogicTreeNode):
'''SeparateQuatNode'''
bl_idname = 'LNSeparateQuatNode'
bl_label = 'Separate Quat'
bl_icon = 'QUESTION'
def init(self, context):
s... | en | 0.178899 | SeparateQuatNode | 2.590006 | 3 |
tests/implementation_utils.py | btk15049/online-judge-tools | 2 | 6632639 | <reponame>btk15049/online-judge-tools<gh_stars>1-10
import bs4
import onlinejudge._implementation.logging as log
import onlinejudge._implementation.testcase_zipper
import onlinejudge._implementation.utils as utils
from onlinejudge.type import *
def get_handmade_sample_cases(self, *, html: str) -> List[TestCase]:
... | import bs4
import onlinejudge._implementation.logging as log
import onlinejudge._implementation.testcase_zipper
import onlinejudge._implementation.utils as utils
from onlinejudge.type import *
def get_handmade_sample_cases(self, *, html: str) -> List[TestCase]:
# parse
soup = bs4.BeautifulSoup(html, utils.ht... | none | 1 | 2.302789 | 2 | |
src/python/grpcio/tests/unit/_adapter/_intermediary_low_test.py | DiracResearch/grpc | 1 | 6632640 | <reponame>DiracResearch/grpc
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | en | 0.719406 | # Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f... | 1.413204 | 1 |
crawler.py | DeenisLan/python_crawler | 0 | 6632641 | <reponame>DeenisLan/python_crawler<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# In[7]:
import requests
from bs4 import BeautifulSoup
from urllib.request import Request
from urllib.request import urlopen
import os
import sys
import pandas as pd
from datetime import date
today = date.today()
d = today.strftim... | #!/usr/bin/env python
# coding: utf-8
# In[7]:
import requests
from bs4 import BeautifulSoup
from urllib.request import Request
from urllib.request import urlopen
import os
import sys
import pandas as pd
from datetime import date
today = date.today()
d = today.strftime("%Y-%b-%d")
raw_request = Request('https://s... | en | 0.651871 | #!/usr/bin/env python # coding: utf-8 # In[7]: #Here you can do whatever you want with the data! You can findAll table row headers, etc... # DataFrame # Converting Pandas DataFrame # DataFrame # print(newDataFrame) # into CSV file | 2.991289 | 3 |
qasrl/pipelines/afirst_pipeline_sequential.py | gililior/qasrl-modeling | 1 | 6632642 | # completely ridiculous hack to import stuff properly. somebody save me from myself
import importlib
from allennlp.common.util import import_submodules
importlib.invalidate_caches()
import sys
sys.path.append(".")
import_submodules("qasrl")
from typing import List, Iterator, Optional, Set
import torch, os, json, tar... | # completely ridiculous hack to import stuff properly. somebody save me from myself
import importlib
from allennlp.common.util import import_submodules
importlib.invalidate_caches()
import sys
sys.path.append(".")
import_submodules("qasrl")
from typing import List, Iterator, Optional, Set
import torch, os, json, tar... | en | 0.899541 | # completely ridiculous hack to import stuff properly. somebody save me from myself # Modifies original pipeline to output a hierarchical representation of the beam (span -> question). Span -> question pipeline. Outputs a sentence per line as a JSON object. The output format for each sentence is: { "sen... | 1.970061 | 2 |
Leetcode/0121. Best Time to Buy and Sell Stock/0121.py | Next-Gen-UI/Code-Dynamics | 0 | 6632643 | class Solution:
def maxProfit(self, prices: List[int]) -> int:
sellOne = 0
holdOne = -math.inf
for price in prices:
sellOne = max(sellOne, holdOne + price)
holdOne = max(holdOne, -price)
return sellOne
| class Solution:
def maxProfit(self, prices: List[int]) -> int:
sellOne = 0
holdOne = -math.inf
for price in prices:
sellOne = max(sellOne, holdOne + price)
holdOne = max(holdOne, -price)
return sellOne
| none | 1 | 3.213969 | 3 | |
urduhack/conll/tests/__init__.py | cinfotech94/urduhackk | 252 | 6632644 | # coding: utf8
"""Conll test cases"""
| # coding: utf8
"""Conll test cases"""
| ca | 0.394952 | # coding: utf8 Conll test cases | 1.001009 | 1 |
iceworm/engine/tests/test_dual.py | wrmsr0/iceworm | 0 | 6632645 | <gh_stars>0
from omnibus import check
from .. import connectors as ctrs
from .. import elements as els
def test_dual():
elements = els.ElementSet.of([
ctrs.impls.dual.DualConnector.Config(),
])
connectors = ctrs.ConnectorSet.of(elements.get_type_set(ctrs.Connector.Config))
conn = check.isin... | from omnibus import check
from .. import connectors as ctrs
from .. import elements as els
def test_dual():
elements = els.ElementSet.of([
ctrs.impls.dual.DualConnector.Config(),
])
connectors = ctrs.ConnectorSet.of(elements.get_type_set(ctrs.Connector.Config))
conn = check.isinstance(conne... | none | 1 | 2.151895 | 2 | |
tests/test_attribute_copy.py | iAndriy/marshmallow_dataclass | 342 | 6632646 | <gh_stars>100-1000
import dataclasses
import unittest
import marshmallow.validate
from marshmallow_dataclass import class_schema
class TestAttributesCopy(unittest.TestCase):
def test_meta_class_copied(self):
@dataclasses.dataclass
class Anything:
class Meta:
pass
... | import dataclasses
import unittest
import marshmallow.validate
from marshmallow_dataclass import class_schema
class TestAttributesCopy(unittest.TestCase):
def test_meta_class_copied(self):
@dataclasses.dataclass
class Anything:
class Meta:
pass
schema = class... | none | 1 | 2.589873 | 3 | |
messagebird/voice_recording.py | smadivad/sreemessage | 57 | 6632647 | <filename>messagebird/voice_recording.py
from messagebird.base import Base
class VoiceRecording(Base):
def __init__(self):
self.id = None
self.format = None
self.type = None
self.legId = None
self.status = None
self.duration = None
self._createdDatetime = N... | <filename>messagebird/voice_recording.py
from messagebird.base import Base
class VoiceRecording(Base):
def __init__(self):
self.id = None
self.format = None
self.type = None
self.legId = None
self.status = None
self.duration = None
self._createdDatetime = N... | none | 1 | 2.668937 | 3 | |
tests/settings.py | jdolter/django-tagulous | 0 | 6632648 | """
Django settings for test project.
"""
import os
import re
import django
testenv = re.sub(
r"[^a-zA-Z0-9]",
"_",
os.environ.get("TOXENV", "_".join(str(v) for v in django.VERSION)),
)
tests_migration_module_name = "migrations_{}".format(testenv)
INSTALLED_APPS = [
"django.contrib.auth",
"djan... | """
Django settings for test project.
"""
import os
import re
import django
testenv = re.sub(
r"[^a-zA-Z0-9]",
"_",
os.environ.get("TOXENV", "_".join(str(v) for v in django.VERSION)),
)
tests_migration_module_name = "migrations_{}".format(testenv)
INSTALLED_APPS = [
"django.contrib.auth",
"djan... | en | 0.810623 | Django settings for test project. # If pyyaml is installed, add to serialisers # noqa # Build database settings # Make sure test DB is going to be UTF8 # Make sure the django migration loader will find MIGRATION_MODULES # This will be cleaned away after each test | 2.097349 | 2 |
examples/Draw.py | nodedge/pyqtgraph | 1 | 6632649 | # -*- coding: utf-8 -*-
"""
Demonstrate ability of ImageItem to be used as a canvas for painting with
the mouse.
"""
import initExample ## Add path to library (just for examples; you do not need this)
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
import pyqtgraph as pg
app = pg.mkQApp("Draw Example")
... | # -*- coding: utf-8 -*-
"""
Demonstrate ability of ImageItem to be used as a canvas for painting with
the mouse.
"""
import initExample ## Add path to library (just for examples; you do not need this)
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
import pyqtgraph as pg
app = pg.mkQApp("Draw Example")
... | en | 0.847118 | # -*- coding: utf-8 -*- Demonstrate ability of ImageItem to be used as a canvas for painting with the mouse. ## Add path to library (just for examples; you do not need this) ## Create window with GraphicsView widget ## lock the aspect ratio ## Create image item ## Set initial view bounds ## start drawing with 3x3 brush | 3.013595 | 3 |
Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/purearrays/ex08_add_one_example.py | Kreijeck/learning | 0 | 6632650 | <reponame>Kreijeck/learning<filename>Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/purearrays/ex08_add_one_example.py
# Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by <NAME>
import numpy as np
from ch06_arrays.solutions.ex08_add_one import add_one
def main():
# Wr... | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by <NAME>
import numpy as np
from ch06_arrays.solutions.ex08_add_one import add_one
def main():
# Wrap result in numpy array
result = add_one(np.array([1, 3, 2, 4]))
result_as_array = np.array(result)
print(result) # [1, 3, 2, 5... | en | 0.377414 | # Beispielprogramm für das Buch "Python Challenge" # # Copyright 2020 by <NAME> # Wrap result in numpy array # [1, 3, 2, 5] # [1 3 2 5] # [1, 4, 9, 0] # [1, 0, 0, 0, 0] | 3.790612 | 4 |