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
python/wotdbg.py
wanyancan/wot-debugserver
32
11000
import os.path import tcprepl import BigWorld def echo(s): '''Send string to client''' if tcprepl.write_client is not None: tcprepl.write_client(s) def exec_file(filename, exec_globals=None): ''' Execute file Try to find file named `filename` and execute it. If `exec_globals` is spec...
import os.path import tcprepl import BigWorld def echo(s): '''Send string to client''' if tcprepl.write_client is not None: tcprepl.write_client(s) def exec_file(filename, exec_globals=None): ''' Execute file Try to find file named `filename` and execute it. If `exec_globals` is spec...
en
0.888551
Send string to client Execute file Try to find file named `filename` and execute it. If `exec_globals` is specified it is used as globals-dict in exec context.
2.864611
3
quicken/_internal/__init__.py
chrahunt/quicken
3
11001
<gh_stars>1-10 class QuickenError(Exception): pass
class QuickenError(Exception): pass
none
1
1.106911
1
folderikon/exceptions.py
demberto/FolderIkon
1
11002
"""Exception which are not actually thrown, only their docstrings are used.""" import colorama import sys __all__ = [ "Error", "ParentIsNotAFolderError", "InvalidURLError", "ImageFormatNotSupportedError", "ImageNotSpecifiedError", "FolderIconAlreadyExistsError", "DesktopIniError", "exc...
"""Exception which are not actually thrown, only their docstrings are used.""" import colorama import sys __all__ = [ "Error", "ParentIsNotAFolderError", "InvalidURLError", "ImageFormatNotSupportedError", "ImageNotSpecifiedError", "FolderIconAlreadyExistsError", "DesktopIniError", "exc...
en
0.930715
Exception which are not actually thrown, only their docstrings are used. Base class for all FolderIkon errors. Argument passed to --parent is not a folder. Invalid image URL An image with a supported format could not be found in this directory. Folder icon already exists. The 'desktop.ini' file could not be parsed. Del...
2.776467
3
quickbooks/objects/companycurrency.py
varunbheemaiah/python-quickbooks
234
11003
<gh_stars>100-1000 from six import python_2_unicode_compatible from .base import QuickbooksManagedObject, QuickbooksTransactionEntity, Ref, CustomField, MetaData @python_2_unicode_compatible class CompanyCurrency(QuickbooksManagedObject, QuickbooksTransactionEntity): """ QBO definition: Applicable only for th...
from six import python_2_unicode_compatible from .base import QuickbooksManagedObject, QuickbooksTransactionEntity, Ref, CustomField, MetaData @python_2_unicode_compatible class CompanyCurrency(QuickbooksManagedObject, QuickbooksTransactionEntity): """ QBO definition: Applicable only for those companies that ...
en
0.907715
QBO definition: Applicable only for those companies that enable multicurrency, a companycurrency object defines a currency that is active in the QuickBooks Online company. One or more companycurrency objects are active based on the company's multicurrency business requirements and correspond to the list dis...
2.523574
3
books/migrations/0004_alter_book_category.py
MwinyiMoha/books-service
0
11004
# Generated by Django 3.2 on 2021-04-10 12:34 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("books", "0003_auto_20210410_1231")] operations = [ migrations.AlterField( model_name="book", name="category", field=mod...
# Generated by Django 3.2 on 2021-04-10 12:34 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("books", "0003_auto_20210410_1231")] operations = [ migrations.AlterField( model_name="book", name="category", field=mod...
en
0.823201
# Generated by Django 3.2 on 2021-04-10 12:34
1.713404
2
syft/execution/placeholder.py
juharris/PySyft
0
11005
<reponame>juharris/PySyft from itertools import zip_longest import syft from syft.generic.frameworks.hook import hook_args from syft.generic.abstract.tensor import AbstractTensor from syft.workers.abstract import AbstractWorker from syft_proto.execution.v1.placeholder_pb2 import Placeholder as PlaceholderPB class Pl...
from itertools import zip_longest import syft from syft.generic.frameworks.hook import hook_args from syft.generic.abstract.tensor import AbstractTensor from syft.workers.abstract import AbstractWorker from syft_proto.execution.v1.placeholder_pb2 import Placeholder as PlaceholderPB class PlaceHolder(AbstractTensor):...
en
0.834134
A PlaceHolder acts as a tensor but does nothing special. It can get "instantiated" when a real tensor is appended as a child attribute. It will send forward all the commands it receives to its child tensor. When you send a PlaceHolder, you don't sent the instantiated tensors. Args: ...
2.200541
2
creativeflow/blender/render_main.py
idaho777/creativeflow
53
11006
""" MAIN STYLING AND RENDERING FILE Requirements: ------------------------------------------------------------------------------ IMPORTANT! This has only been tested with Blender 2.79 API. We have run this on Linux and MacOS. Execution: ------------------------------------------------------------------------------ Th...
""" MAIN STYLING AND RENDERING FILE Requirements: ------------------------------------------------------------------------------ IMPORTANT! This has only been tested with Blender 2.79 API. We have run this on Linux and MacOS. Execution: ------------------------------------------------------------------------------ Th...
en
0.494696
MAIN STYLING AND RENDERING FILE Requirements: ------------------------------------------------------------------------------ IMPORTANT! This has only been tested with Blender 2.79 API. We have run this on Linux and MacOS. Execution: ------------------------------------------------------------------------------ This s...
2.023993
2
atlas/foundations_contrib/src/test/archiving/test_artifact_downloader.py
DeepLearnI/atlas
296
11007
from foundations_spec import * from unittest.mock import call class TestArtifactDownloader(Spec): mock_archiver = let_mock() make_directory_mock = let_patch_mock('os.makedirs') @let def source_directory(self): return self.faker.uri_path() @let def download_directory(self): ...
from foundations_spec import * from unittest.mock import call class TestArtifactDownloader(Spec): mock_archiver = let_mock() make_directory_mock = let_patch_mock('os.makedirs') @let def source_directory(self): return self.faker.uri_path() @let def download_directory(self): ...
none
1
2.321716
2
lib/python3.5/functional/test/test_functional.py
mklan/NX-Rom-Market
21
11008
<filename>lib/python3.5/functional/test/test_functional.py # pylint: skip-file import unittest import array from collections import namedtuple from itertools import product from functional.pipeline import Sequence, is_iterable, _wrap, extend from functional.transformations import name from functional import seq, pseq ...
<filename>lib/python3.5/functional/test/test_functional.py # pylint: skip-file import unittest import array from collections import namedtuple from itertools import product from functional.pipeline import Sequence, is_iterable, _wrap, extend from functional.transformations import name from functional import seq, pseq ...
en
0.35169
# pylint: skip-file # test keyword args # test args # test final # a more complex example combining all above
2.452094
2
tests/test_git_commit_one_file.py
mubashshirjamal/code
1,582
11009
<reponame>mubashshirjamal/code # -*- coding: utf-8 -*- import os from vilya.models.project import CodeDoubanProject from vilya.models import git from tests.base import TestCase from tests.utils import mkdtemp from vilya.libs import gyt from vilya.libs.permdir import get_repo_root class TestGit(TestCase): @pr...
# -*- coding: utf-8 -*- import os from vilya.models.project import CodeDoubanProject from vilya.models import git from tests.base import TestCase from tests.utils import mkdtemp from vilya.libs import gyt from vilya.libs.permdir import get_repo_root class TestGit(TestCase): @property def u(self): ...
en
0.890485
# -*- coding: utf-8 -*- # TODO allow commiting more than one file # noqa # Now artificially rewind the index tree state # the latest commit should not have anything related to file1
2.17199
2
py/desitarget/train/data_preparation/PredCountsFromQLF_ClassModule.py
echaussidon/desitarget
13
11010
<reponame>echaussidon/desitarget #!/usr/bin/env python3 # -*- coding:utf-8 -*- import re import numpy as np from scipy.interpolate import interp2d from scipy.interpolate import interp1d class PredCountsFromQLF_Class(): def __init__(self): self.QLF_OK = False self.EFF_OK = False self.QLF_E...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- import re import numpy as np from scipy.interpolate import interp2d from scipy.interpolate import interp1d class PredCountsFromQLF_Class(): def __init__(self): self.QLF_OK = False self.EFF_OK = False self.QLF_EFF_OK = False # QLF ...
en
0.33854
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # QLF # self.QLF_tabz = None # EFF # QLF_EFF # Data loading in "dataStr" # ZRED # self.QLF_tabz = self.QLF_zlimit[0:-1] + self.QLF_stepz / 2. # MAG # QLF_EFF_zlimit # QLF_EFFmaglimit # EFF # ============================================================================== # ...
2.142239
2
safe_control_gym/controllers/__init__.py
gokhanalcan/safe-control-gym
0
11011
"""Register controllers. """ from safe_control_gym.utils.registration import register register(id="mpc", entry_point="safe_control_gym.controllers.mpc.mpc:MPC", config_entry_point="safe_control_gym.controllers.mpc:mpc.yaml") register(id="linear_mpc", entry_point="safe_control_gym.controlle...
"""Register controllers. """ from safe_control_gym.utils.registration import register register(id="mpc", entry_point="safe_control_gym.controllers.mpc.mpc:MPC", config_entry_point="safe_control_gym.controllers.mpc:mpc.yaml") register(id="linear_mpc", entry_point="safe_control_gym.controlle...
en
0.815406
Register controllers.
1.429357
1
tests/plot_profile/test_utils.py
mizeller/plot_profile
0
11012
"""Test module ``plot_profile/utils.py``.""" # Standard library import logging # First-party from plot_profile.utils import count_to_log_level def test_count_to_log_level(): assert count_to_log_level(0) == logging.ERROR assert count_to_log_level(1) == logging.WARNING assert count_to_log_level(2) == loggi...
"""Test module ``plot_profile/utils.py``.""" # Standard library import logging # First-party from plot_profile.utils import count_to_log_level def test_count_to_log_level(): assert count_to_log_level(0) == logging.ERROR assert count_to_log_level(1) == logging.WARNING assert count_to_log_level(2) == loggi...
en
0.28412
Test module ``plot_profile/utils.py``. # Standard library # First-party
2.005052
2
spider/utilities/util_config.py
YunofHD/PSpider
0
11013
<reponame>YunofHD/PSpider<gh_stars>0 # _*_ coding: utf-8 _*_ """ util_config.py by xianhu """ __all__ = [ "CONFIG_FETCH_MESSAGE", "CONFIG_PARSE_MESSAGE", "CONFIG_MESSAGE_PATTERN", "CONFIG_URL_LEGAL_PATTERN", "CONFIG_URL_ILLEGAL_PATTERN", ] # define the structure of message, used in Fetcher and Pa...
# _*_ coding: utf-8 _*_ """ util_config.py by xianhu """ __all__ = [ "CONFIG_FETCH_MESSAGE", "CONFIG_PARSE_MESSAGE", "CONFIG_MESSAGE_PATTERN", "CONFIG_URL_LEGAL_PATTERN", "CONFIG_URL_ILLEGAL_PATTERN", ] # define the structure of message, used in Fetcher and Parser CONFIG_FETCH_MESSAGE = "priority...
en
0.770137
# _*_ coding: utf-8 _*_ util_config.py by xianhu # define the structure of message, used in Fetcher and Parser # define url_legal_pattern and url_illegal_pattern
1.913109
2
modcma/__main__.py
IOHprofiler/ModularCMAES
2
11014
"""Allows the user to call the library as a cli-module.""" from argparse import ArgumentParser from .modularcmaes import evaluate_bbob parser = ArgumentParser(description="Run single function CMAES") parser.add_argument( "-f", "--fid", type=int, help="bbob function id", required=False, default=5 ) parser.add_ar...
"""Allows the user to call the library as a cli-module.""" from argparse import ArgumentParser from .modularcmaes import evaluate_bbob parser = ArgumentParser(description="Run single function CMAES") parser.add_argument( "-f", "--fid", type=int, help="bbob function id", required=False, default=5 ) parser.add_ar...
en
0.811723
Allows the user to call the library as a cli-module. # pylint: disable=exec-used
2.941069
3
src/rto/optimization/solvers/de.py
vicrsp/rto
0
11015
<filename>src/rto/optimization/solvers/de.py import numpy as np class DifferentialEvolution: def __init__(self, lb, ub, mutation_prob=0.5, pop_size=10, max_generations=100, de_type='rand/1/bin', callback=None): self.lb = np.asarray(lb).reshape(1, -1) self.ub = np.asarray(ub).reshape(1, -1) ...
<filename>src/rto/optimization/solvers/de.py import numpy as np class DifferentialEvolution: def __init__(self, lb, ub, mutation_prob=0.5, pop_size=10, max_generations=100, de_type='rand/1/bin', callback=None): self.lb = np.asarray(lb).reshape(1, -1) self.ub = np.asarray(ub).reshape(1, -1) ...
en
0.533981
# Calculating the fitness value of each solution in the current population. # U(0.5, 1.0) # replace the variable by a random value inside the bounds # only use the rule for restricted problems # use penalization for base vector selection only # fobj_penalized = fobj + 1000 * np.maximum(np.zeros(self.population_size), n...
2.659669
3
openmdao/matrices/csr_matrix.py
onodip/OpenMDAO
0
11016
"""Define the CSRmatrix class.""" import numpy as np from scipy.sparse import coo_matrix from six import iteritems from openmdao.matrices.coo_matrix import COOMatrix class CSRMatrix(COOMatrix): """ Sparse matrix in Compressed Row Storage format. """ def _build(self, num_rows, num_cols): """...
"""Define the CSRmatrix class.""" import numpy as np from scipy.sparse import coo_matrix from six import iteritems from openmdao.matrices.coo_matrix import COOMatrix class CSRMatrix(COOMatrix): """ Sparse matrix in Compressed Row Storage format. """ def _build(self, num_rows, num_cols): """...
en
0.851016
Define the CSRmatrix class. Sparse matrix in Compressed Row Storage format. Allocate the matrix. Parameters ---------- num_rows : int number of rows in the matrix. num_cols : int number of cols in the matrix. # get a set of indices that sorts into row major order...
2.826345
3
setup.py
medchemfi/sdfconf
6
11017
# -*- coding: utf-8 -*- from setuptools import setup, find_packages import re import os def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() with open("src/sdfconf/_version.py", "rt") as vf: VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" for line in vf: mo = re.search...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages import re import os def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() with open("src/sdfconf/_version.py", "rt") as vf: VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" for line in vf: mo = re.search...
en
0.253645
# -*- coding: utf-8 -*- #'Programming Language :: Python :: 3', ##FIXME #''' #package_data = { # 'sample':['sample_data.sdf'] # }, #'''
1.781397
2
stacks/cognito_stack.py
adamdubey/devops-serverless-app-aws-cdk
0
11018
from aws_cdk import ( aws_cognito as cognito, aws_iam as iam, aws_ssm as ssm, core ) class CognitoStack(core.Stack): def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: super().__init__(scope, id, **kwargs) prj_name = self.node.try_get_context("project_name") ...
from aws_cdk import ( aws_cognito as cognito, aws_iam as iam, aws_ssm as ssm, core ) class CognitoStack(core.Stack): def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: super().__init__(scope, id, **kwargs) prj_name = self.node.try_get_context("project_name") ...
none
1
2.015064
2
cloudrail/knowledge/rules/aws/context_aware/s3_bucket_policy_vpc_endpoint_rule.py
my-devops-info/cloudrail-knowledge
0
11019
<reponame>my-devops-info/cloudrail-knowledge from typing import Dict, List from cloudrail.knowledge.context.aws.iam.policy import S3Policy from cloudrail.knowledge.context.aws.iam.policy_statement import StatementEffect from cloudrail.knowledge.context.aws.s3.s3_bucket import S3Bucket from cloudrail.knowledge.context....
from typing import Dict, List from cloudrail.knowledge.context.aws.iam.policy import S3Policy from cloudrail.knowledge.context.aws.iam.policy_statement import StatementEffect from cloudrail.knowledge.context.aws.s3.s3_bucket import S3Bucket from cloudrail.knowledge.context.aws.ec2.vpc import Vpc from cloudrail.knowled...
none
1
1.869348
2
src/gluonts/core/serde/_json.py
PascalIversen/gluon-ts
1
11020
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
en
0.772529
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
3.383098
3
run.py
Aisbergg/docker-image-arch-aur-makepkg
7
11021
<gh_stars>1-10 #!/usr/bin/python3 import argparse import os import sys import re import shutil import tempfile import pwd import grp import tarfile import time import glob import urllib.request from subprocess import Popen, PIPE import aur import pacman local_source_dir = '/makepkg/local_src' build_dir = os.path.absp...
#!/usr/bin/python3 import argparse import os import sys import re import shutil import tempfile import pwd import grp import tarfile import time import glob import urllib.request from subprocess import Popen, PIPE import aur import pacman local_source_dir = '/makepkg/local_src' build_dir = os.path.abspath('/makepkg/b...
en
0.764018
#!/usr/bin/python3 Invalid package source exception. Args: message (str): Message passed with the exception No such package exception. Args: message (str): Message passed with the exception Print a colorful info message. Args: message (str): Message to be printed Print a colorful ...
2.480114
2
test/test_schemagen.py
hd23408/nist-schemagen
1
11022
<reponame>hd23408/nist-schemagen<filename>test/test_schemagen.py """Test methods for testing the schemagen package (specifically, the SchemaGenerator class). Typical usage example: python -m unittest or, to run a single test: python -m unittest -k test__build_schema """ import unittest import pathlib import...
"""Test methods for testing the schemagen package (specifically, the SchemaGenerator class). Typical usage example: python -m unittest or, to run a single test: python -m unittest -k test__build_schema """ import unittest import pathlib import logging import copy import os import pandas as pd import numpy a...
en
0.811691
Test methods for testing the schemagen package (specifically, the SchemaGenerator class). Typical usage example: python -m unittest or, to run a single test: python -m unittest -k test__build_schema # Suppress log messages so they don't confuse readers of the test output # Sample files for testing # Test da...
3.154289
3
core/migrations/0008_auto_20190528_1802.py
peterson-dev/code-snippet-app
2
11023
<reponame>peterson-dev/code-snippet-app # Generated by Django 2.2.1 on 2019-05-28 22:02 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0007_auto_20190523_1740'), ] operations = [ migrations.RenameField( model_name='snippet'...
# Generated by Django 2.2.1 on 2019-05-28 22:02 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0007_auto_20190523_1740'), ] operations = [ migrations.RenameField( model_name='snippet', old_name='post_content', ...
en
0.684127
# Generated by Django 2.2.1 on 2019-05-28 22:02
1.644789
2
scripts/Biupdownsample/grad_check.py
dongdong93/a2u_matting
22
11024
import os.path as osp import sys import subprocess subprocess.call(['pip', 'install', 'cvbase']) import cvbase as cvb import torch from torch.autograd import gradcheck sys.path.append(osp.abspath(osp.join(__file__, '../../'))) from biupdownsample import biupsample_naive, BiupsampleNaive from biupdownsample import bid...
import os.path as osp import sys import subprocess subprocess.call(['pip', 'install', 'cvbase']) import cvbase as cvb import torch from torch.autograd import gradcheck sys.path.append(osp.abspath(osp.join(__file__, '../../'))) from biupdownsample import biupsample_naive, BiupsampleNaive from biupdownsample import bid...
en
0.122082
# ---------------------------------------------------------------
2.040396
2
sunshinectf2020/speedrun/exploit_05.py
nhtri2003gmail/ctf-write-ups
101
11025
<reponame>nhtri2003gmail/ctf-write-ups<filename>sunshinectf2020/speedrun/exploit_05.py #!/usr/bin/env python3 from pwn import * binary = context.binary = ELF('./chall_05') if not args.REMOTE: p = process(binary.path) else: p = remote('chal.2020.sunshinectf.org', 30005) p.sendlineafter('Race, life\'s greatest.\n',...
#!/usr/bin/env python3 from pwn import * binary = context.binary = ELF('./chall_05') if not args.REMOTE: p = process(binary.path) else: p = remote('chal.2020.sunshinectf.org', 30005) p.sendlineafter('Race, life\'s greatest.\n','foobar') p.recvuntil('Yes I\'m going to win: ') _ = p.recvline().strip() main = int(_...
fr
0.221828
#!/usr/bin/env python3
1.930642
2
coderedcms/wagtail_flexible_forms/edit_handlers.py
mikiec84/coderedcms
9
11026
from django.template.loader import render_to_string from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ from wagtail.admin.edit_handlers import EditHandler class FormSubmissionsPanel(EditHandler): template = "wagtailforms/edit_handlers/form_responses_panel.html" ...
from django.template.loader import render_to_string from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ from wagtail.admin.edit_handlers import EditHandler class FormSubmissionsPanel(EditHandler): template = "wagtailforms/edit_handlers/form_responses_panel.html" ...
none
1
1.912741
2
python/elasticache/cache/helper/vpc.py
chejef/aws-cdk-examples-proserve
6
11027
<reponame>chejef/aws-cdk-examples-proserve<filename>python/elasticache/cache/helper/vpc.py<gh_stars>1-10 from aws_cdk import ( core as cdk, aws_elasticache as elasticache, aws_ec2 as ec2, ) from aws_cdk.core import Tags from config import config_util as config def get_vpc(scope: cdk.Construct) -> ec2.Vpc...
from aws_cdk import ( core as cdk, aws_elasticache as elasticache, aws_ec2 as ec2, ) from aws_cdk.core import Tags from config import config_util as config def get_vpc(scope: cdk.Construct) -> ec2.Vpc: """ Look up and return the none default vpc. Args: scope: the cdk construct. ...
en
0.696445
Look up and return the none default vpc. Args: scope: the cdk construct. Returns: ec2.Vpc: The ec2 VPC object based on the vpc id. Create and return the security group for the cluster which allows for any ipv4 and configured port number. Args: scope: the cdk construct. Return...
2.412134
2
src/pyscaffold/extensions/namespace.py
jayvdb/pyscaffold
2
11028
# -*- coding: utf-8 -*- """ Extension that adjust project file tree to include a namespace package. This extension adds a **namespace** option to :obj:`~pyscaffold.api.create_project` and provides correct values for the options **root_pkg** and **namespace_pkg** to the following functions in the action list. """ impo...
# -*- coding: utf-8 -*- """ Extension that adjust project file tree to include a namespace package. This extension adds a **namespace** option to :obj:`~pyscaffold.api.create_project` and provides correct values for the options **root_pkg** and **namespace_pkg** to the following functions in the action list. """ impo...
en
0.590325
# -*- coding: utf-8 -*- Extension that adjust project file tree to include a namespace package. This extension adds a **namespace** option to :obj:`~pyscaffold.api.create_project` and provides correct values for the options **root_pkg** and **namespace_pkg** to the following functions in the action list. Add a namespa...
2.307367
2
tests/solr_tests/tests/test_templatetags.py
speedplane/django-haystack
1
11029
# encoding: utf-8 from mock import call, patch from django.template import Template, Context from django.test import TestCase from core.models import MockModel @patch("haystack.templatetags.more_like_this.SearchQuerySet") class MoreLikeThisTagTestCase(TestCase): def render(self, template, context): # Wh...
# encoding: utf-8 from mock import call, patch from django.template import Template, Context from django.test import TestCase from core.models import MockModel @patch("haystack.templatetags.more_like_this.SearchQuerySet") class MoreLikeThisTagTestCase(TestCase): def render(self, template, context): # Wh...
en
0.516587
# encoding: utf-8 # Why on Earth does Django not have a TemplateTestCase yet? {% load more_like_this %}{% more_like_this entry as related_content %}{% for rc in related_content %}{{ rc.id }}{% endfor %} {% load more_like_this %}{% more_like_this entry as related_content limit 5 %}{% for rc in related_content %}{{ rc.id...
2.445172
2
tests_project/homepage/views/__init__.py
wynnw/django-mako-plus
79
11030
<filename>tests_project/homepage/views/__init__.py<gh_stars>10-100 from django_mako_plus.converter import ParameterConverter from django_mako_plus import view_function from django.http import HttpRequest class RecordingConverter(ParameterConverter): '''Converter that also records the converted variables for inspe...
<filename>tests_project/homepage/views/__init__.py<gh_stars>10-100 from django_mako_plus.converter import ParameterConverter from django_mako_plus import view_function from django.http import HttpRequest class RecordingConverter(ParameterConverter): '''Converter that also records the converted variables for inspe...
en
0.877142
Converter that also records the converted variables for inspecting during testing # request is usually args[0], but it can be args[1] when using functools.partial in the decorator
2.35992
2
jupyterlab_bigquery/jupyterlab_bigquery/__init__.py
shunr/jupyter-extensions
0
11031
<filename>jupyterlab_bigquery/jupyterlab_bigquery/__init__.py from notebook.utils import url_path_join from jupyterlab_bigquery.list_items_handler import handlers from jupyterlab_bigquery.details_handler import DatasetDetailsHandler, TablePreviewHandler, TableDetailsHandler from jupyterlab_bigquery.version import VERS...
<filename>jupyterlab_bigquery/jupyterlab_bigquery/__init__.py from notebook.utils import url_path_join from jupyterlab_bigquery.list_items_handler import handlers from jupyterlab_bigquery.details_handler import DatasetDetailsHandler, TablePreviewHandler, TableDetailsHandler from jupyterlab_bigquery.version import VERS...
en
0.806664
Called when the extension is loaded. Args: nb_server_app (NotebookWebApplication): handle to the Notebook webserver instance. # TODO(cbwilkes): Add auth checking if needed. # (url_path_join(gcp_v1_endpoint, auth'), AuthHandler) Called by IPython when this module is loaded as an IPython extension.
2.188219
2
ios_notifications/migrations/0004_auto_20141105_1515.py
chillbear/django-ios-notifications
2
11032
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_fields.fields class Migration(migrations.Migration): dependencies = [ ('ios_notifications', '0003_notification_loc_payload'), ] operations = [ migrations.AlterField( ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_fields.fields class Migration(migrations.Migration): dependencies = [ ('ios_notifications', '0003_notification_loc_payload'), ] operations = [ migrations.AlterField( ...
en
0.769321
# -*- coding: utf-8 -*-
1.60539
2
fairseq/tasks/audio_pretraining.py
hwp/fairseq
4
11033
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import editdistance import os impo...
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import editdistance import os impo...
en
0.841869
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. Add task-specific arguments to the ...
1.858177
2
caffe-int8-convert-tool-dev.py
daquexian/caffe-int8-convert-tools
0
11034
<reponame>daquexian/caffe-int8-convert-tools<gh_stars>0 # -*- coding: utf-8 -*- # SenseNets is pleased to support the open source community by making caffe-int8-convert-tool available. # # Copyright (C) 2018 SenseNets Technology Ltd. All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); you...
# -*- coding: utf-8 -*- # SenseNets is pleased to support the open source community by making caffe-int8-convert-tool available. # # Copyright (C) 2018 SenseNets Technology Ltd. All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); you may not use this file except # in compliance with the L...
en
0.703519
# -*- coding: utf-8 -*- # SenseNets is pleased to support the open source community by making caffe-int8-convert-tool available. # # Copyright (C) 2018 SenseNets Technology Ltd. All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); you may not use this file except # in compliance with the Li...
1.674576
2
example_project/views.py
AKuederle/flask-template-master
2
11035
""" All your views aka. your template endpoints go here. There are two ways to create a view. 1. Create a new Subclass inheriting from one of the flask_template_master views 2. Use the view-factory function flask_template_master.views.create_template_endpoint Each view requires an 1 (and 2 optional) things: 1. An envi...
""" All your views aka. your template endpoints go here. There are two ways to create a view. 1. Create a new Subclass inheriting from one of the flask_template_master views 2. Use the view-factory function flask_template_master.views.create_template_endpoint Each view requires an 1 (and 2 optional) things: 1. An envi...
en
0.714738
All your views aka. your template endpoints go here. There are two ways to create a view. 1. Create a new Subclass inheriting from one of the flask_template_master views 2. Use the view-factory function flask_template_master.views.create_template_endpoint Each view requires an 1 (and 2 optional) things: 1. An environm...
3.07457
3
CustomExceptions.py
DouglasHSS/NeuralNetworks
0
11036
class PerceptronError(Exception): pass
class PerceptronError(Exception): pass
none
1
1.198231
1
pytorch_translate/test/test_data.py
dpacgopinath/translate-1
0
11037
<filename>pytorch_translate/test/test_data.py<gh_stars>0 #!/usr/bin/env python3 import unittest import os from pytorch_translate import data from pytorch_translate import dictionary from pytorch_translate.test import utils as test_utils class TestInMemoryNumpyDataset(unittest.TestCase): def setUp(self): ...
<filename>pytorch_translate/test/test_data.py<gh_stars>0 #!/usr/bin/env python3 import unittest import os from pytorch_translate import data from pytorch_translate import dictionary from pytorch_translate.test import utils as test_utils class TestInMemoryNumpyDataset(unittest.TestCase): def setUp(self): ...
en
0.684303
#!/usr/bin/env python3 # src_ref is reversed, +1 for lua # +1 for lua # +1 for lua
2.439336
2
CompareWHDR.py
Z7Gao/InverseRenderingOfIndoorScene
171
11038
<filename>CompareWHDR.py import numpy as np import sys import json import glob import os.path as osp import cv2 def compute_whdr(reflectance, judgements, delta=0.1): points = judgements['intrinsic_points'] comparisons = judgements['intrinsic_comparisons'] id_to_points = {p['id']: p for p in points} row...
<filename>CompareWHDR.py import numpy as np import sys import json import glob import os.path as osp import cv2 def compute_whdr(reflectance, judgements, delta=0.1): points = judgements['intrinsic_points'] comparisons = judgements['intrinsic_comparisons'] id_to_points = {p['id']: p for p in points} row...
en
0.847834
# "darker" is "J_i" in our paper # "darker_score" is "w_i" in our paper # convert to grayscale and threshold # convert algorithm value to the same units as human judgements #root = './testReal_cascade0_black_height120_width160/cascade0/iiw/' #load CGI precomputed file
2.776442
3
theonionbox/stamp.py
ralphwetzel/theonionbox
120
11039
__title__ = 'The Onion Box' __description__ = 'Dashboard to monitor Tor node operations.' __version__ = '20.2' __stamp__ = '20200119|095654'
__title__ = 'The Onion Box' __description__ = 'Dashboard to monitor Tor node operations.' __version__ = '20.2' __stamp__ = '20200119|095654'
none
1
0.826225
1
UnicodeTraps.py
loamhoof/sublime-plugins-dump
0
11040
import re from sublime import Region import sublime_plugin REPLACEMENTS = { '\u00a0': ' ', # no-break space '\u200b': '', # zero-width space } class UnicodeTrapsListener(sublime_plugin.EventListener): @staticmethod def on_pre_save(view): view.run_command('unicode_traps') class UnicodeTrap...
import re from sublime import Region import sublime_plugin REPLACEMENTS = { '\u00a0': ' ', # no-break space '\u200b': '', # zero-width space } class UnicodeTrapsListener(sublime_plugin.EventListener): @staticmethod def on_pre_save(view): view.run_command('unicode_traps') class UnicodeTrap...
en
0.342033
# no-break space # zero-width space
2.587231
3
simba/ROI_multiply.py
KonradDanielewski/simba
172
11041
<filename>simba/ROI_multiply.py import glob import pandas as pd from configparser import ConfigParser import os from simba.drop_bp_cords import * def multiplyFreeHand(inifile, currVid): _, CurrVidName, ext = get_fn_ext(currVid) config = ConfigParser() configFile = str(inifile) config.read(con...
<filename>simba/ROI_multiply.py import glob import pandas as pd from configparser import ConfigParser import os from simba.drop_bp_cords import * def multiplyFreeHand(inifile, currVid): _, CurrVidName, ext = get_fn_ext(currVid) config = ConfigParser() configFile = str(inifile) config.read(con...
none
1
2.477392
2
src/utils/ccxt/fetch_order_book.py
YasunoriMATSUOKA/crypto-asset-easy-management
0
11042
<filename>src/utils/ccxt/fetch_order_book.py from logging import getLogger import traceback from .get_public_exchange import get_public_exchange logger = getLogger("__main__").getChild(__name__) def fetch_order_book(exchange_name, pair): logger.debug("start") logger.debug(exchange_name) logger.debug(pair...
<filename>src/utils/ccxt/fetch_order_book.py from logging import getLogger import traceback from .get_public_exchange import get_public_exchange logger = getLogger("__main__").getChild(__name__) def fetch_order_book(exchange_name, pair): logger.debug("start") logger.debug(exchange_name) logger.debug(pair...
none
1
2.526543
3
smoke-classifier/detect_fire.py
agnes-yang/firecam
10
11043
<reponame>agnes-yang/firecam<gh_stars>1-10 # Copyright 2018 The Fuego 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 re...
# Copyright 2018 The Fuego 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 or agreed to in wr...
en
0.822586
# Copyright 2018 The Fuego 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 or agreed to in wr...
1.64246
2
torch_agents/cogment_verse_torch_agents/third_party/hive/mlp.py
kharyal/cogment-verse
0
11044
import math import numpy as np import torch import torch.nn.functional as F from torch import nn class SimpleMLP(nn.Module): """Simple MLP function approximator for Q-Learning.""" def __init__(self, in_dim, out_dim, hidden_units=256, num_hidden_layers=1): super().__init__() self.input_layer...
import math import numpy as np import torch import torch.nn.functional as F from torch import nn class SimpleMLP(nn.Module): """Simple MLP function approximator for Q-Learning.""" def __init__(self, in_dim, out_dim, hidden_units=256, num_hidden_layers=1): super().__init__() self.input_layer...
en
0.734221
Simple MLP function approximator for Q-Learning. NoisyLinear Layer MLP function approximator for Q-Learning. In dueling, we have two heads - one for estimating advantage function and one for estimating value function. If `noisy` is also true, then each of these layers will be NoisyLinear() Distr...
2.850565
3
phonenumbers/data/region_AC.py
ayushgoel/FixGoogleContacts
2
11045
"""Auto-generated file, do not edit by hand. AC metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_AC = PhoneMetadata(id='AC', country_code=247, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[2-467]\\d{3}', possible_number_pattern=...
"""Auto-generated file, do not edit by hand. AC metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_AC = PhoneMetadata(id='AC', country_code=247, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[2-467]\\d{3}', possible_number_pattern=...
en
0.807673
Auto-generated file, do not edit by hand. AC metadata
1.87354
2
awx/main/migrations/0156_capture_mesh_topology.py
ziegenberg/awx
1
11046
<reponame>ziegenberg/awx # Generated by Django 2.2.20 on 2021-12-17 19:26 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('main', '0155_improved_health_check'), ] operations = [ migrations.AlterField( ...
# Generated by Django 2.2.20 on 2021-12-17 19:26 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('main', '0155_improved_health_check'), ] operations = [ migrations.AlterField( model_name='inst...
en
0.861542
# Generated by Django 2.2.20 on 2021-12-17 19:26
1.740202
2
models/dsd/bicubic.py
VinAIResearch/blur-kernel-space-exploring
93
11047
import torch from torch import nn from torch.nn import functional as F class BicubicDownSample(nn.Module): def bicubic_kernel(self, x, a=-0.50): """ This equation is exactly copied from the website below: https://clouard.users.greyc.fr/Pantheon/experiments/rescaling/index-en.html#bicubic ...
import torch from torch import nn from torch.nn import functional as F class BicubicDownSample(nn.Module): def bicubic_kernel(self, x, a=-0.50): """ This equation is exactly copied from the website below: https://clouard.users.greyc.fr/Pantheon/experiments/rescaling/index-en.html#bicubic ...
en
0.629509
This equation is exactly copied from the website below: https://clouard.users.greyc.fr/Pantheon/experiments/rescaling/index-en.html#bicubic # k = torch.einsum('i,j->ij', (k, k)) # x = torch.from_numpy(x).type('torch.FloatTensor') # compute actual padding values for each side # apply mirror padding # NHWC to NCH...
2.709462
3
control/webapp/__init__.py
doismellburning/control-panel
1
11048
<gh_stars>1-10 import logging from flask import Flask from . import utils, home, member, society, signup, jobs, admin from .flask_seasurf import SeaSurf from flask_talisman import Talisman app = Flask(__name__, template_folder="../templates", static_folder="../static") app.config['CSRF_CHEC...
import logging from flask import Flask from . import utils, home, member, society, signup, jobs, admin from .flask_seasurf import SeaSurf from flask_talisman import Talisman app = Flask(__name__, template_folder="../templates", static_folder="../static") app.config['CSRF_CHECK_REFERER'] = F...
none
1
1.918037
2
tests/rules/test_duplicates.py
imbillu/arche
1
11049
<gh_stars>1-10 import arche.rules.duplicates as duplicates from arche.rules.result import Level, Outcome from conftest import create_result import numpy as np import pandas as pd import pytest unique_inputs = [ ({}, {}, {Level.INFO: [(Outcome.SKIPPED,)]}), ( {"id": ["0", "0", "1"]}, {"unique":...
import arche.rules.duplicates as duplicates from arche.rules.result import Level, Outcome from conftest import create_result import numpy as np import pandas as pd import pytest unique_inputs = [ ({}, {}, {Level.INFO: [(Outcome.SKIPPED,)]}), ( {"id": ["0", "0", "1"]}, {"unique": ["id"]}, ...
none
1
2.568185
3
Question_1.py
Queen-Jonnie/Work
0
11050
# This is the word list from where the answers for the hangman game will come from. word_list = [ 2015, "<NAME>", "Rwanda and Mauritius", 2, "Dr, <NAME>", "<NAME>", "Madagascar", 94, 8, "Mauritius" ] # Here we are defining the variables 'Right'(for when they get th...
# This is the word list from where the answers for the hangman game will come from. word_list = [ 2015, "<NAME>", "Rwanda and Mauritius", 2, "Dr, <NAME>", "<NAME>", "Madagascar", 94, 8, "Mauritius" ] # Here we are defining the variables 'Right'(for when they get th...
en
0.887208
# This is the word list from where the answers for the hangman game will come from. # Here we are defining the variables 'Right'(for when they get the question correct) and \n # 'tries'(for when they get a question wrong). # This function below after called, will greet the user when they input their name. # This functi...
4.272429
4
node-api/get-block-transfers/request.py
Venoox/casper-integrations
5
11051
<reponame>Venoox/casper-integrations import json import os import pycspr # A known casper test-net node address. _NODE_ADDRESS = os.getenv("CASPER_NODE_ADDRESS", "192.168.127.12") # A known block hash. _BLOCK_HASH: bytes = bytes.fromhex("c7148e1e2e115d8fba357e04be2073d721847c982dc70d5c36b5f6d3cf66331c") # A known...
import json import os import pycspr # A known casper test-net node address. _NODE_ADDRESS = os.getenv("CASPER_NODE_ADDRESS", "192.168.127.12") # A known block hash. _BLOCK_HASH: bytes = bytes.fromhex("c7148e1e2e115d8fba357e04be2073d721847c982dc70d5c36b5f6d3cf66331c") # A known block height. _BLOCK_HEIGHT: int = 2...
en
0.977558
# A known casper test-net node address. # A known block hash. # A known block height. Retrieves transfers by block. # Set client. # Set block by known hash. # Set block by known height. # Verify block information equivalence.
2.501363
3
tests/test_util.py
re3turn/twicrawler
14
11052
import nose2.tools from typing import Union from app.util import has_attributes class SampleClass: pass class TestUtil: @nose2.tools.params( ('SET_VALUE', True), (None, False), ('NO_ATTRIBUTE', False), (False, True), ('', True), (0, True), ) def test...
import nose2.tools from typing import Union from app.util import has_attributes class SampleClass: pass class TestUtil: @nose2.tools.params( ('SET_VALUE', True), (None, False), ('NO_ATTRIBUTE', False), (False, True), ('', True), (0, True), ) def test...
none
1
2.825545
3
commands/data/fusion_data.py
Christ0ph990/Fusion360DevTools
3
11053
# 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.851243
# 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 ...
2.010581
2
src/config-producer/config_topic.py
DougFigueroa/realde-kafka-assesment
0
11054
""" This process creates the two kafka topics to be used. The input-topic with ten partitions and the output-topic with one partition. Also preloads the kafka cluster with test data (if flag is set to true). """ import os import time import json import logging from confluent_kafka.admin import AdminClient, NewTopic fro...
""" This process creates the two kafka topics to be used. The input-topic with ten partitions and the output-topic with one partition. Also preloads the kafka cluster with test data (if flag is set to true). """ import os import time import json import logging from confluent_kafka.admin import AdminClient, NewTopic fro...
en
0.814
This process creates the two kafka topics to be used. The input-topic with ten partitions and the output-topic with one partition. Also preloads the kafka cluster with test data (if flag is set to true). # defining logger # reading the environement variables defined on the docker compose Read the json configuration fil...
2.731719
3
deallocate/params.py
jefferycwc/tacker-example-plugin
0
11055
OS_MA_NFVO_IP = '192.168.1.197' OS_USER_DOMAIN_NAME = 'Default' OS_USERNAME = 'admin' OS_PASSWORD = '<PASSWORD>' OS_PROJECT_DOMAIN_NAME = 'Default' OS_PROJECT_NAME = 'admin'
OS_MA_NFVO_IP = '192.168.1.197' OS_USER_DOMAIN_NAME = 'Default' OS_USERNAME = 'admin' OS_PASSWORD = '<PASSWORD>' OS_PROJECT_DOMAIN_NAME = 'Default' OS_PROJECT_NAME = 'admin'
none
1
1.126653
1
anoplura/patterns/body_part.py
rafelafrance/traiter_lice
0
11056
<gh_stars>0 """Extract body part annotations.""" import re import spacy from traiter.const import COMMA from traiter.patterns.matcher_patterns import MatcherPatterns from anoplura.pylib.const import COMMON_PATTERNS from anoplura.pylib.const import CONJ from anoplura.pylib.const import MISSING from anoplura.pylib.cons...
"""Extract body part annotations.""" import re import spacy from traiter.const import COMMA from traiter.patterns.matcher_patterns import MatcherPatterns from anoplura.pylib.const import COMMON_PATTERNS from anoplura.pylib.const import CONJ from anoplura.pylib.const import MISSING from anoplura.pylib.const import REP...
en
0.532107
Extract body part annotations. Enrich a body part span.
2.506505
3
Termux-pkg-apt.py
Hironotori/Termux-pkg-apt
1
11057
#!/usr/bin/python3 import os import time import sys os.system("clear") print('''\033[91m CREATED BY Hironotori ''') def slowprint(s): for c in s + '\n' : sys.stdout.write(c) sys.stdout.flush() slowprint(''' \033[93m [1] apt-pkg pip-pip3 [2] apt-pkg python [3] apt-pkg python2 [4] ...
#!/usr/bin/python3 import os import time import sys os.system("clear") print('''\033[91m CREATED BY Hironotori ''') def slowprint(s): for c in s + '\n' : sys.stdout.write(c) sys.stdout.flush() slowprint(''' \033[93m [1] apt-pkg pip-pip3 [2] apt-pkg python [3] apt-pkg python2 [4] ...
ko
0.217283
#!/usr/bin/python3 \033[91m CREATED BY Hironotori \033[93m [1] apt-pkg pip-pip3 [2] apt-pkg python [3] apt-pkg python2 [4] apt-pkg bash [5] apt-pkg git [6] apt-pkg perl [7] apt-pkg nano [8] apt-pkg curl [9] apt-pkg openssl [10] apt-pkg openssh [11] apt-pkg wget ...
2.425315
2
RFEM/Loads/solidSetLoad.py
DavidNaizheZhou/RFEM_Python_Client
16
11058
<reponame>DavidNaizheZhou/RFEM_Python_Client<gh_stars>10-100 from RFEM.initModel import Model, clearAtributes, ConvertToDlString from RFEM.enums import SolidSetLoadType, SolidSetLoadDistribution, SolidSetLoadDirection class SolidSetLoad(): def __init__(self, no: int =1, load_case...
from RFEM.initModel import Model, clearAtributes, ConvertToDlString from RFEM.enums import SolidSetLoadType, SolidSetLoadDistribution, SolidSetLoadDirection class SolidSetLoad(): def __init__(self, no: int =1, load_case_no: int = 1, solid_sets_no: str= '1', ...
en
0.268969
# Client model | Solid Load # Clears object attributes | Sets all attributes to None # Load No. # Load Case No. # Assigned Solid No. # Load Type # Load Distribution # Load Direction # Load Magnitude # Comment # Adding optional parameters via dictionary # Add Solid Load to client model # Client model | Solid Load # Clea...
2.193948
2
examples_2d/patch.py
5A5H/PyFEMP
1
11059
<gh_stars>1-10 # 2D example tensile test import numpy as np import matplotlib.pyplot as plt import PyFEMP import PyFEMP.elements.Elmt_BaMo_2D as ELEMENT FEM = PyFEMP.FEM_Simulation(ELEMENT) n = 4 XI, Elem = PyFEMP.msh_rec([0.0, 0.0], [10.0, 10.0], [n, n], type='Q1') FEM.Add_Mesh(XI, Elem) FEM.Add_Material([2100, 0.3...
# 2D example tensile test import numpy as np import matplotlib.pyplot as plt import PyFEMP import PyFEMP.elements.Elmt_BaMo_2D as ELEMENT FEM = PyFEMP.FEM_Simulation(ELEMENT) n = 4 XI, Elem = PyFEMP.msh_rec([0.0, 0.0], [10.0, 10.0], [n, n], type='Q1') FEM.Add_Mesh(XI, Elem) FEM.Add_Material([2100, 0.3], "All") FEM.A...
en
0.159763
# 2D example tensile test
2.430753
2
common-patterns/producer_consumer_client.py
kyeett/websockets-examples
0
11060
<reponame>kyeett/websockets-examples #!/usr/bin/env python import asyncio import websockets import os port = int(os.environ.get('PORT', '8765')) async def hello(): print("Starting client on :%s" % port) async with websockets.connect('ws://localhost:%s' % port) as websocket: msg = 'Client msg #1' ...
#!/usr/bin/env python import asyncio import websockets import os port = int(os.environ.get('PORT', '8765')) async def hello(): print("Starting client on :%s" % port) async with websockets.connect('ws://localhost:%s' % port) as websocket: msg = 'Client msg #1' await websocket.send(msg) ...
ru
0.174772
#!/usr/bin/env python #1'
3.148407
3
wagtailflags/forms.py
cfpb/wagtail-flags
75
11061
<filename>wagtailflags/forms.py from django import forms from flags.forms import FlagStateForm as DjangoFlagsFlagStateForm from flags.models import FlagState from flags.sources import get_flags class NewFlagForm(forms.ModelForm): name = forms.CharField(label="Name", required=True) def clean_name(self): ...
<filename>wagtailflags/forms.py from django import forms from flags.forms import FlagStateForm as DjangoFlagsFlagStateForm from flags.models import FlagState from flags.sources import get_flags class NewFlagForm(forms.ModelForm): name = forms.CharField(label="Name", required=True) def clean_name(self): ...
none
1
2.296928
2
src/utils/utils.py
GuiYuDaniel/CGC_of_Sn
0
11062
<reponame>GuiYuDaniel/CGC_of_Sn<filename>src/utils/utils.py # -*- coding:utf8 -*- """ 一些其他工具 当需要细化或者函数太多时,应该把其中一些独立出去 """ import uuid from enum import Enum, unique from utils.log import get_logger logger = get_logger(__name__) @unique class PipeTaskStatus(Enum): # 还不够需要写状态机,先用这个凑活一下 """ name is Status ...
# -*- coding:utf8 -*- """ 一些其他工具 当需要细化或者函数太多时,应该把其中一些独立出去 """ import uuid from enum import Enum, unique from utils.log import get_logger logger = get_logger(__name__) @unique class PipeTaskStatus(Enum): # 还不够需要写状态机,先用这个凑活一下 """ name is Status value is Next """ # TODO 多线程时应该增加STOPPING, WAITIN...
zh
0.852479
# -*- coding:utf8 -*- 一些其他工具 当需要细化或者函数太多时,应该把其中一些独立出去 # 还不够需要写状态机,先用这个凑活一下 name is Status value is Next # TODO 多线程时应该增加STOPPING, WAITING等状态 # TODO 为了避免Enum键值对别名的规则,引入一个None占位,None无意义,不是一个状态! # preparation是准备阶段,计算、保存一切运行的必要信息,未准备结束的ppt是不支持restart的 # restarting是重启的准备阶段,准备好后直接进入doing # STOPPING = [] # WAITING = []
2.423702
2
extras/scripts/finish_ci.py
connornishijima/PixieChroma
20
11063
<reponame>connornishijima/PixieChroma # This is just for GitHub, and is used to clean up leftover files after # automatic testing has completed, and generate developer reports about # anything left undocumented! # run: "sudo python ./extras/scripts/finish_ci.py" import os import sys os.system("sudo python ./extras/s...
# This is just for GitHub, and is used to clean up leftover files after # automatic testing has completed, and generate developer reports about # anything left undocumented! # run: "sudo python ./extras/scripts/finish_ci.py" import os import sys os.system("sudo python ./extras/scripts/generate_doxygen_report.py") os...
en
0.898303
# This is just for GitHub, and is used to clean up leftover files after # automatic testing has completed, and generate developer reports about # anything left undocumented! # run: "sudo python ./extras/scripts/finish_ci.py"
2.195991
2
matchingGame.py
VinnieM-3/MemoryGames
0
11064
import pygame import random pygame.init() pygame.font.init() class Card(object): """ The Card Class """ def __init__(self, left, top, width, height, back_color, front_color, solved_color, display, font_color, text_font, value=None): self._rect = pyg...
import pygame import random pygame.init() pygame.font.init() class Card(object): """ The Card Class """ def __init__(self, left, top, width, height, back_color, front_color, solved_color, display, font_color, text_font, value=None): self._rect = pyg...
en
0.942055
The Card Class # color of card when face down # color of card when face up # color of card after it is matched # the number we are trying to match # is set to false once matched # card is face down to start # number of times player viewed card # did player click on this card? This function returns the card that matches...
3.574226
4
darts_search_space/imagenet/rlnas/evolution_search/config.py
megvii-model/RLNAS
17
11065
import os class config: host = 'zhangxuanyang.zhangxuanyang.ws2.hh-c.brainpp.cn' username = 'admin' port = 5672 exp_name = os.path.dirname(os.path.abspath(__file__)) exp_name = '-'.join(i for i in exp_name.split(os.path.sep) if i); test_send_pipe = exp_name + '-test-send_pipe' test_recv_p...
import os class config: host = 'zhangxuanyang.zhangxuanyang.ws2.hh-c.brainpp.cn' username = 'admin' port = 5672 exp_name = os.path.dirname(os.path.abspath(__file__)) exp_name = '-'.join(i for i in exp_name.split(os.path.sep) if i); test_send_pipe = exp_name + '-test-send_pipe' test_recv_p...
en
0.579686
# Candidate operators # Operators encoding #time_limit=0.050 # max_flops=None # Enumerate all paths of a single cell
1.561515
2
packages/python/plotly/plotly/graph_objs/layout/geo/_projection.py
eranws/plotly.py
0
11066
<reponame>eranws/plotly.py<filename>packages/python/plotly/plotly/graph_objs/layout/geo/_projection.py<gh_stars>0 from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Projection(_BaseLayoutHierarchyType): # class properties # -------------------- ...
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Projection(_BaseLayoutHierarchyType): # class properties # -------------------- _parent_path_str = "layout.geo" _path_str = "layout.geo.projection" _valid_props = {"parallels", "rotatio...
en
0.527459
# class properties # -------------------- # parallels # --------- For conic projection types only. Sets the parallels (tangent, secant) where the cone intersects the sphere. The 'parallels' property is an info array that may be specified as: * a list or tuple of 2 elements where: (...
3.161049
3
j3d/string_table.py
blank63/j3dview
13
11067
from btypes.big_endian import * cstring_sjis = CString('shift-jis') class Header(Struct): string_count = uint16 __padding__ = Padding(2) class Entry(Struct): string_hash = uint16 string_offset = uint16 def unsigned_to_signed_byte(b): return b - 0x100 if b & 0x80 else b def calculate_hash(s...
from btypes.big_endian import * cstring_sjis = CString('shift-jis') class Header(Struct): string_count = uint16 __padding__ = Padding(2) class Entry(Struct): string_hash = uint16 string_offset = uint16 def unsigned_to_signed_byte(b): return b - 0x100 if b & 0x80 else b def calculate_hash(s...
none
1
2.699096
3
deConzSensors.py
peterstadler/deConzSensors
0
11068
#!/usr/bin/env python3.5 from time import sleep, time from datetime import datetime, timedelta from pid.decorator import pidfile #from subprocess import call from RPi import GPIO import requests import json #import config import logging import signal import sys #13: grün #16: braun #19: orange #20: grün #21: braun #2...
#!/usr/bin/env python3.5 from time import sleep, time from datetime import datetime, timedelta from pid.decorator import pidfile #from subprocess import call from RPi import GPIO import requests import json #import config import logging import signal import sys #13: grün #16: braun #19: orange #20: grün #21: braun #2...
en
0.478818
#!/usr/bin/env python3.5 #from subprocess import call #import config #13: grün #16: braun #19: orange #20: grün #21: braun #26: orange # deConz REST API settings # API key for the deConz REST API # IP address of the deConz REST API, e.g. "192.168.1.100" # scheme for the deConz REST API, e.g. "http" # program settings #...
2.489221
2
src/admin.py
kappa243/agh-db-proj
0
11069
<filename>src/admin.py from flask import Blueprint, request, render_template, flash, redirect, url_for from flask_login import login_user, login_required, current_user, logout_user from models import User from werkzeug.security import generate_password_hash, check_password_hash from app import db, login_manager admin ...
<filename>src/admin.py from flask import Blueprint, request, render_template, flash, redirect, url_for from flask_login import login_user, login_required, current_user, logout_user from models import User from werkzeug.security import generate_password_hash, check_password_hash from app import db, login_manager admin ...
none
1
2.405064
2
test/lib/test_map.py
oldmantaiter/inferno
1
11070
import datetime import types from nose.tools import eq_ from nose.tools import ok_ from inferno.lib.map import keyset_map from inferno.lib.rule import InfernoRule class TestKeysetMap(object): def setUp(self): self.data = { 'city': 'toronto', 'country': 'canada', 'pop...
import datetime import types from nose.tools import eq_ from nose.tools import ok_ from inferno.lib.map import keyset_map from inferno.lib.rule import InfernoRule class TestKeysetMap(object): def setUp(self): self.data = { 'city': 'toronto', 'country': 'canada', 'pop...
en
0.875309
# key parts are str casted & json serialized, value parts are are not # (note the difference between the key date and value date results) # turn disco_debug on for more code coverage
2.445587
2
dart/build_rules/internal/pub.bzl
nickclmb/rules_dart
0
11071
<reponame>nickclmb/rules_dart # Copyright 2016 The Bazel Authors. 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 # # Un...
# Copyright 2016 The Bazel Authors. 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 la...
en
0.769876
# Copyright 2016 The Bazel Authors. 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 la...
1.572122
2
auror_core/__init__.py
millengustavo/auror-core
11
11072
<reponame>millengustavo/auror-core<gh_stars>10-100 import copy import os class Project(object): def __init__(self, folder, *jobtypes): self.jobtypes = jobtypes self.folder = folder self.params = [] self.version = 1 def is_v2(self): self.version = 2 return copy...
import copy import os class Project(object): def __init__(self, folder, *jobtypes): self.jobtypes = jobtypes self.folder = folder self.params = [] self.version = 1 def is_v2(self): self.version = 2 return copy.deepcopy(self) def is_v1(self): self....
none
1
3.057927
3
app.py
Vaishnavid14/snakegame
5
11073
<reponame>Vaishnavid14/snakegame<filename>app.py ''' Purpose: Server responsible for routing Author: Md. <NAME> Command to execute: python app.py ''' from flask import Flask from flask import render_template from flask import json from flask import request import random import sys app = Flask(__nam...
''' Purpose: Server responsible for routing Author: Md. <NAME> Command to execute: python app.py ''' from flask import Flask from flask import render_template from flask import json from flask import request import random import sys app = Flask(__name__) print("Server is live...", file = sys.std...
en
0.721515
Purpose: Server responsible for routing Author: Md. <NAME> Command to execute: python app.py # init user # data to be sent # sets the user's name # sets the user's speed # append it to the list of users # sends the x and y coordinates to the client # sends the size of the snake to the server Function: dimensions ...
3.092169
3
grafana_api/api/__init__.py
sedan07/grafana_api
0
11074
<filename>grafana_api/api/__init__.py from .base import Base from .admin import Admin from .dashboard import Dashboard from .datasource import Datasource from .folder import Folder from .organisation import Organisation, Organisations from .search import Search from .user import User, Users
<filename>grafana_api/api/__init__.py from .base import Base from .admin import Admin from .dashboard import Dashboard from .datasource import Datasource from .folder import Folder from .organisation import Organisation, Organisations from .search import Search from .user import User, Users
none
1
1.075696
1
shop/views.py
Ayushman-Singh/ecommerce
1
11075
from shop.forms import UserForm from django.views import generic from django.urls import reverse_lazy from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import auth from .models import Product, Contact, Categ...
from shop.forms import UserForm from django.views import generic from django.urls import reverse_lazy from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import auth from .models import Product, Contact, Categ...
en
0.70422
# from PayTm import checksum # Create your views here. # wishlist = Wishlist.objects.filter(user=request.user) # 'wishlist': wishlist return true only if query matches the item # Fetch the product using the id # zip_code=zip_code, # phone=phone, # amount=amount # id = order.order_id # Request paytm to transfer the amou...
2.059844
2
SimMuon/GEMDigitizer/python/muonGEMDigi_cff.py
NTrevisani/cmssw
3
11076
import FWCore.ParameterSet.Config as cms from SimMuon.GEMDigitizer.muonGEMDigis_cfi import * from SimMuon.GEMDigitizer.muonGEMPadDigis_cfi import * from SimMuon.GEMDigitizer.muonGEMPadDigiClusters_cfi import * muonGEMDigiTask = cms.Task(simMuonGEMDigis, simMuonGEMPadDigis, simMuonGEMPadDigiClusters) muonGEMDigi = cms...
import FWCore.ParameterSet.Config as cms from SimMuon.GEMDigitizer.muonGEMDigis_cfi import * from SimMuon.GEMDigitizer.muonGEMPadDigis_cfi import * from SimMuon.GEMDigitizer.muonGEMPadDigiClusters_cfi import * muonGEMDigiTask = cms.Task(simMuonGEMDigis, simMuonGEMPadDigis, simMuonGEMPadDigiClusters) muonGEMDigi = cms...
none
1
1.093694
1
paas-ce/paas/esb/lib/redis_rate_limit/ratelimit.py
renmcc/bk-PaaS
767
11077
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2018 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-2018 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.705931
# -*- coding: utf-8 -*- Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2018 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...
2.125648
2
tela_cadastro_loja_embala.py
lucasHashi/PyQt5-gerenciador-de-vendas-de-comidas
1
11078
<reponame>lucasHashi/PyQt5-gerenciador-de-vendas-de-comidas import sys from PyQt5 import QtCore, QtGui, QtWidgets, uic import database_receita import pyqt5_aux qt_tela_inicial = "telas/tela_cadastro_loja_embala.ui" Ui_MainWindow, QtBaseClass = uic.loadUiType(qt_tela_inicial) class MainWindow(QtWidgets.QMainWindow, Ui...
import sys from PyQt5 import QtCore, QtGui, QtWidgets, uic import database_receita import pyqt5_aux qt_tela_inicial = "telas/tela_cadastro_loja_embala.ui" Ui_MainWindow, QtBaseClass = uic.loadUiType(qt_tela_inicial) class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): switch_tela_gerenciar_loja_embala = QtCor...
en
0.185096
#CONFIG BOTOES #CARREGAR COMBO INGREDIENTES #QUANDO UM INGREDIENTE FOR SELECIONADO NA COMBO #QUANDO UMA EMBALAGEM FOR DOUBLE-CLICADA #QUANDO SELECIONAR UMA LOJA, COLOCAR NO TXT_LOJA #QUANDO UM CADASTRADO FOR DOUBLE-CLICADO #ATUALIZA A TABLE LOJA_EMBALA #self.carrega_loja_embala() #header.setSectionResizeMode(0, QtWidge...
2.253278
2
test/test_layers.py
mukeshv0/ParallelWaveGAN
0
11079
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2019 <NAME> # MIT License (https://opensource.org/licenses/MIT) import logging import numpy as np import torch from parallel_wavegan.layers import Conv1d from parallel_wavegan.layers import Conv1d1x1 from parallel_wavegan.layers import Conv2d from parallel...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2019 <NAME> # MIT License (https://opensource.org/licenses/MIT) import logging import numpy as np import torch from parallel_wavegan.layers import Conv1d from parallel_wavegan.layers import Conv1d1x1 from parallel_wavegan.layers import Conv2d from parallel...
en
0.552315
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2019 <NAME> # MIT License (https://opensource.org/licenses/MIT)
2.14967
2
geotrek/tourism/models.py
ker2x/Geotrek-admin
0
11080
<gh_stars>0 import os import re import logging from django.conf import settings from django.contrib.gis.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.formats import date_format from easy_thumbnails.alias import aliases from easy_thumbnails.exceptions import InvalidImageFor...
import os import re import logging from django.conf import settings from django.contrib.gis.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.formats import date_format from easy_thumbnails.alias import aliases from easy_thumbnails.exceptions import InvalidImageFormatError fro...
en
0.780276
Populate choices using installed apps names. Used in trek public template. # Choose in which list of choices this type will appear A generic touristic content (accomodation, museum, etc.) in the park Fake type to simulate POI for mobile app v1 A touristic event (conference, workshop, etc.) in the park
1.812842
2
Service_Components/Sink/Sink_DataFlow.py
mydata-sdk/mydata-sdk-1.x
0
11081
<filename>Service_Components/Sink/Sink_DataFlow.py # -*- coding: utf-8 -*- from signed_requests.signed_request_auth import SignedRequest __author__ = 'alpaloma' from flask import Blueprint, current_app, request from helpers import Helpers import requests from json import dumps, loads from DetailedHTTPException import ...
<filename>Service_Components/Sink/Sink_DataFlow.py # -*- coding: utf-8 -*- from signed_requests.signed_request_auth import SignedRequest __author__ = 'alpaloma' from flask import Blueprint, current_app, request from helpers import Helpers import requests from json import dumps, loads from DetailedHTTPException import ...
en
0.727527
# -*- coding: utf-8 -*- # import xmltodict # @api.representation('application/xml') # def output_xml(data, code, headers=None): # if isinstance(data, dict): # xm = {"response": data} # resp = make_response(xmltodict.unparse(xm, pretty=True), code) # resp.headers.extend(headers) # ret...
2.145988
2
Support/Python/tbdata/printing.py
twitchplayskh/open-brush
0
11082
# Copyright 2020 The Tilt Brush 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 or agreed to ...
# Copyright 2020 The Tilt Brush 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 or agreed to ...
en
0.716982
# Copyright 2020 The Tilt Brush 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 or agreed to ...
1.930179
2
src/tests/scenarios/Maxwell_Main.py
ian-cooke/basilisk_mag
0
11083
<reponame>ian-cooke/basilisk_mag<gh_stars>0 ''' ''' ''' ISC License Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notic...
''' ''' ''' ISC License Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all c...
en
0.478512
ISC License Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE ...
1.35613
1
generators/map_parallel.py
CodyKochmann/generators
6
11084
from multiprocessing import Pool from multiprocessing.pool import ThreadPool from queue import Queue from .chunks import chunks __all__ = 'map_parallel', 'map_multicore', 'map_multithread' def _pool_map_stream(pool_type, pipe, fn, workers): assert callable(fn), fn assert isinstance(workers, int), workers ...
from multiprocessing import Pool from multiprocessing.pool import ThreadPool from queue import Queue from .chunks import chunks __all__ = 'map_parallel', 'map_multicore', 'map_multithread' def _pool_map_stream(pool_type, pipe, fn, workers): assert callable(fn), fn assert isinstance(workers, int), workers ...
en
0.845619
This streams map operations through a Pool without needing to load the entire stream into a massive list first, like Pool.map normally requires. This streams map operations through a ThreadPool without needing to load the entire stream into a massive list first, like ThreadPool.map norma...
3.349555
3
apps/bot/classes/messages/attachments/AudioAttachment.py
Xoma163/Petrovich
0
11085
<reponame>Xoma163/Petrovich<filename>apps/bot/classes/messages/attachments/AudioAttachment.py<gh_stars>0 from apps.bot.classes.messages.attachments.Attachment import Attachment class AudioAttachment(Attachment): TYPE = "audio" def __init__(self): super().__init__(self.TYPE) self.duration = No...
from apps.bot.classes.messages.attachments.Attachment import Attachment class AudioAttachment(Attachment): TYPE = "audio" def __init__(self): super().__init__(self.TYPE) self.duration = None def parse_vk_audio(self, event_audio): from petrovich.settings import VK_URL self...
none
1
2.464747
2
app/models.py
TrigeekSpace/academia-bknd
0
11086
""" SQLAlchemy database models. """ from datetime import datetime from depot.fields.sqlalchemy import UploadedFileField from app import db from app.util.data import many_to_many, foreign_key from app.config import TOKEN_LEN class User(db.Model): """ User model class. """ id = db.Column(db.Integer(), primary_k...
""" SQLAlchemy database models. """ from datetime import datetime from depot.fields.sqlalchemy import UploadedFileField from app import db from app.util.data import many_to_many, foreign_key from app.config import TOKEN_LEN class User(db.Model): """ User model class. """ id = db.Column(db.Integer(), primary_k...
en
0.764708
SQLAlchemy database models. User model class. API session class. Abstract base group class. Group model class. Paper model class. # Accurate to the day User model class.
2.690484
3
log.py
GregMorford/testlogging
0
11087
<filename>log.py<gh_stars>0 import logging ## Logging Configuration ## logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) ch = logging.StreamHandler() # console handler ch.setLevel(logging.INFO) fh = logging.FileHandler('logfile.txt') fh.setLevel(logging.INFO) fmtr = logging.Formatter('%(asctime)s |...
<filename>log.py<gh_stars>0 import logging ## Logging Configuration ## logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) ch = logging.StreamHandler() # console handler ch.setLevel(logging.INFO) fh = logging.FileHandler('logfile.txt') fh.setLevel(logging.INFO) fmtr = logging.Formatter('%(asctime)s |...
en
0.82043
## Logging Configuration ## # console handler #disable this to stop console output. This better than print statements as you can disable all console output in 1 spot instead of every print statement.
3.176847
3
hackerrank/BetweenTwoSets.py
0x8b/HackerRank
3
11088
#!/bin/python3 import os def getTotalX(a, b): c = 0 for i in range(max(a), min(b) + 1): if all([i % d == 0 for d in a]) and all([d % i == 0 for d in b]): c += 1 return c if __name__ == "__main__": f = open(os.environ["OUTPUT_PATH"], "w") nm = input().spl...
#!/bin/python3 import os def getTotalX(a, b): c = 0 for i in range(max(a), min(b) + 1): if all([i % d == 0 for d in a]) and all([d % i == 0 for d in b]): c += 1 return c if __name__ == "__main__": f = open(os.environ["OUTPUT_PATH"], "w") nm = input().spl...
ru
0.16812
#!/bin/python3
3.19186
3
utils.py
LlamaSi/Adaptive-PSGAIL
10
11089
import h5py import numpy as np import os, pdb import tensorflow as tf from rllab.envs.base import EnvSpec from rllab.envs.normalized_env import normalize as normalize_env import rllab.misc.logger as logger from sandbox.rocky.tf.algos.trpo import TRPO from sandbox.rocky.tf.policies.gaussian_mlp_policy import Gaussian...
import h5py import numpy as np import os, pdb import tensorflow as tf from rllab.envs.base import EnvSpec from rllab.envs.normalized_env import normalize as normalize_env import rllab.misc.logger as logger from sandbox.rocky.tf.algos.trpo import TRPO from sandbox.rocky.tf.policies.gaussian_mlp_policy import Gaussian...
en
0.798862
Const NGSIM_FILENAME_TO_ID = { 'trajdata_i101_trajectories-0750am-0805am.txt': 1, 'trajdata_i101_trajectories-0805am-0820am.txt': 2, 'trajdata_i101_trajectories-0820am-0835am.txt': 3, 'trajdata_i80_trajectories-0400-0415.txt': 4, 'trajdata_i80_trajectories-0500-0515.txt': 5, 'trajdata_i80_traje...
1.410765
1
setup_py_upgrade.py
asottile/setup-py-upgrade
87
11090
<reponame>asottile/setup-py-upgrade<filename>setup_py_upgrade.py import argparse import ast import configparser import io import os.path from typing import Any from typing import Dict from typing import Optional from typing import Sequence METADATA_KEYS = frozenset(( 'name', 'version', 'url', 'download_url', 'proj...
import argparse import ast import configparser import io import os.path from typing import Any from typing import Dict from typing import Optional from typing import Sequence METADATA_KEYS = frozenset(( 'name', 'version', 'url', 'download_url', 'project_urls', 'author', 'author_email', 'maintainer', 'maintaine...
en
0.91609
# need special processing (as sections) # X( # setuptools.X( # with open("filename", ...) as fvar: # varname = fvar.read() # with open(...) # "filename" # as fvar # varname = # fvar.read() # .read() # fvar. # for mypy's sake # always want these to start with a newline # always start project_urls with a newline as w...
2.026299
2
main/models/__init__.py
prajnamort/LambdaOJ2
2
11091
<gh_stars>1-10 from .user import User, MultiUserUpload from .problem import Problem, TestData from .submit import Submit
from .user import User, MultiUserUpload from .problem import Problem, TestData from .submit import Submit
none
1
0.989013
1
2019/tests/test_Advent2019_10.py
davidxbuck/advent2018
1
11092
<reponame>davidxbuck/advent2018<gh_stars>1-10 # pytest tests import numpy as np from Advent2019_10 import Day10 class TestDay10(): def test_instantiate(self): test = Day10('../tests/test_Advent2019_10a.txt') grid = ['.#..#', '.....', '#####', '....#...
# pytest tests import numpy as np from Advent2019_10 import Day10 class TestDay10(): def test_instantiate(self): test = Day10('../tests/test_Advent2019_10a.txt') grid = ['.#..#', '.....', '#####', '....#', '...##'] grid = [li...
ja
0.41837
# pytest tests #..#', ####', #', ##'] #.#')).all() ####')).all()
2.530006
3
Hash Map/448. Find All Numbers Disappeared in an Array.py
xli1110/LC
2
11093
<reponame>xli1110/LC class Solution: def findDisappearedNumbers(self, nums: List[int]) -> List[int]: if len(nums) < 1: raise Exception("Invalid Array") n = len(nums) res = [] s = set() for x in nums: s.add(x) for i in range(1, n + 1): ...
class Solution: def findDisappearedNumbers(self, nums: List[int]) -> List[int]: if len(nums) < 1: raise Exception("Invalid Array") n = len(nums) res = [] s = set() for x in nums: s.add(x) for i in range(1, n + 1): if i not in s: ...
none
1
3.363512
3
tests/test_demo.py
aaronestrada/flask-restplus-swagger-relative
3
11094
<gh_stars>1-10 import pytest from tests.test_application import app @pytest.fixture def client(): client = app.test_client() yield client def test_hello_resource(client): """ Test if it is possible to access to /hello resource :param client: Test client object :return: """ response =...
import pytest from tests.test_application import app @pytest.fixture def client(): client = app.test_client() yield client def test_hello_resource(client): """ Test if it is possible to access to /hello resource :param client: Test client object :return: """ response = client.get('/h...
en
0.727041
Test if it is possible to access to /hello resource :param client: Test client object :return: Test if Swagger assets are accessible from the new path :param client: Test client object :return:
2.579514
3
01_Introduction to Python/3-functions-and-packages/03_multiple-arguments.py
mohd-faizy/DataScience-With-Python
5
11095
<filename>01_Introduction to Python/3-functions-and-packages/03_multiple-arguments.py ''' 03 - Multiple arguments In the previous exercise, the square brackets around imag in the documentation showed us that the imag argument is optional. But Python also uses a different way to tell users about arguments being optiona...
<filename>01_Introduction to Python/3-functions-and-packages/03_multiple-arguments.py ''' 03 - Multiple arguments In the previous exercise, the square brackets around imag in the documentation showed us that the imag argument is optional. But Python also uses a different way to tell users about arguments being optiona...
en
0.834523
03 - Multiple arguments In the previous exercise, the square brackets around imag in the documentation showed us that the imag argument is optional. But Python also uses a different way to tell users about arguments being optional. Have a look at the documentation of sorted() by typing help(sorted) in the IPython She...
4.694641
5
Taller_Algoritmos_02/Ejercicio_10.py
Angelio01/algoritmos_programacion-
0
11096
<reponame>Angelio01/algoritmos_programacion- """ Entradas: 3 Valores flotantes que son el valor de diferentes monedas Chelines autriacos --> float --> x Dramas griegos --> float --> z Pesetas --> float --> w Salidas 4 valores flotantes que es la conversión de las anteriores monedas Pesetas --> float --> x Francos...
""" Entradas: 3 Valores flotantes que son el valor de diferentes monedas Chelines autriacos --> float --> x Dramas griegos --> float --> z Pesetas --> float --> w Salidas 4 valores flotantes que es la conversión de las anteriores monedas Pesetas --> float --> x Francos franceses --> float --> z Dolares --> float...
es
0.646959
Entradas: 3 Valores flotantes que son el valor de diferentes monedas Chelines autriacos --> float --> x Dramas griegos --> float --> z Pesetas --> float --> w Salidas 4 valores flotantes que es la conversión de las anteriores monedas Pesetas --> float --> x Francos franceses --> float --> z Dolares --> float -->...
4.05887
4
stardist/stardist_impl/predict_stardist_3d.py
constantinpape/deep-cell
0
11097
import argparse import os from glob import glob import imageio from tqdm import tqdm from csbdeep.utils import normalize from stardist.models import StarDist3D def get_image_files(root, image_folder, ext): # get the image and label mask paths and validate them image_pattern = os.path.join(root, image_folder...
import argparse import os from glob import glob import imageio from tqdm import tqdm from csbdeep.utils import normalize from stardist.models import StarDist3D def get_image_files(root, image_folder, ext): # get the image and label mask paths and validate them image_pattern = os.path.join(root, image_folder...
en
0.828269
# get the image and label mask paths and validate them # could be done more efficiently, see # https://github.com/hci-unihd/batchlib/blob/master/batchlib/segmentation/stardist_prediction.py # load the model # normalization parameters: lower and upper percentile used for image normalization # maybe these should be expos...
2.4315
2
estacionamientos/forms.py
ShadowManu/SAGE
0
11098
<reponame>ShadowManu/SAGE<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- from django import forms from estacionamientos.models import Estacionamiento, Reserva, Pago class EstacionamientosForm(forms.ModelForm): nombre_duenio = forms.CharField(widget=forms.TextInput( attrs={'class': 'form-control'...
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import forms from estacionamientos.models import Estacionamiento, Reserva, Pago class EstacionamientosForm(forms.ModelForm): nombre_duenio = forms.CharField(widget=forms.TextInput( attrs={'class': 'form-control', 'placeholder': 'Nombre del Dueño'})...
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
2.201649
2
src/krylov/gmres.py
nschloe/krylov
36
11099
<gh_stars>10-100 """ <NAME>, <NAME>, GMRES: a generalized minimal residual algorithm for solving nonsymmetric linear systems, SIAM J. Sci. and Stat. Comput., 7(3), 856–869, 1986, <https://doi.org/10.1137/0907058>. Other implementations: <https://petsc.org/release/docs/manualpages/KSP/KSPGMRES.html> """ from __future__...
""" <NAME>, <NAME>, GMRES: a generalized minimal residual algorithm for solving nonsymmetric linear systems, SIAM J. Sci. and Stat. Comput., 7(3), 856–869, 1986, <https://doi.org/10.1137/0907058>. Other implementations: <https://petsc.org/release/docs/manualpages/KSP/KSPGMRES.html> """ from __future__ import annotatio...
en
0.754692
<NAME>, <NAME>, GMRES: a generalized minimal residual algorithm for solving nonsymmetric linear systems, SIAM J. Sci. and Stat. Comput., 7(3), 856–869, 1986, <https://doi.org/10.1137/0907058>. Other implementations: <https://petsc.org/release/docs/manualpages/KSP/KSPGMRES.html> A @ b for many A, b (i.e., A.shape == (m...
2.854151
3