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 |
|---|---|---|---|---|---|---|---|---|---|---|
perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py | inflatador/PerfKitBenchmarker | 0 | 6631251 | # Copyright 2019 PerfKitBenchmarker 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 appli... | # Copyright 2019 PerfKitBenchmarker 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 appli... | en | 0.768055 | # Copyright 2019 PerfKitBenchmarker 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 appli... | 1.784285 | 2 |
mpms/src/crawler.py | dadosjusbr/coletores | 18 | 6631252 | import pathlib
import os
import sys
from time import sleep
import shutil
from selenium import webdriver
from selenium.webdriver.common.by import By
BASE_URL = 'https://transparencia.mpms.mp.br/QvAJAXZfc/opendoc.htm?document=portaltransparencia%5Cportaltransparencia.qvw&lang=pt-BR&host=QVS%40srv-1645&anonymous=true'
M... | import pathlib
import os
import sys
from time import sleep
import shutil
from selenium import webdriver
from selenium.webdriver.common.by import By
BASE_URL = 'https://transparencia.mpms.mp.br/QvAJAXZfc/opendoc.htm?document=portaltransparencia%5Cportaltransparencia.qvw&lang=pt-BR&host=QVS%40srv-1645&anonymous=true'
M... | pt | 0.825527 | # Usar o mês passado como parâmetro para pegar o equivalente em string # Usar o mês passado como parâmetro para pegar o equivalente em string # Seting the directorys to be used by selenium # Attributing the paths to the webdriver # find_main_contain = driver.find_element_by_css_selector('.QvPageBody') # Usado para sele... | 2.909616 | 3 |
updater/__init__.py | daguar/srtracker | 2 | 6631253 | # Copyright (C) 2012, Code for America
# This is open source software, released under a standard 3-clause
# BSD-style license; see the file LICENSE for details.
from update import subscribe, subscription_exists, unsubscribe, subscription_for_key, unsubscribe_with_key
| # Copyright (C) 2012, Code for America
# This is open source software, released under a standard 3-clause
# BSD-style license; see the file LICENSE for details.
from update import subscribe, subscription_exists, unsubscribe, subscription_for_key, unsubscribe_with_key
| en | 0.858194 | # Copyright (C) 2012, Code for America # This is open source software, released under a standard 3-clause # BSD-style license; see the file LICENSE for details. | 0.803589 | 1 |
model-optimizer/mo/front/common/partial_infer/utils.py | undeadinu/dldt | 1 | 6631254 | """
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | """
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | en | 0.884808 | Copyright (c) 2018 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing,... | 1.856518 | 2 |
sgas/authz/ctxinsertchecker.py | kmjonsson/luts3-service | 0 | 6631255 | <reponame>kmjonsson/luts3-service
"""
Usage Records insertion checker.
Provides functionality for checking if a host should be able to insert a given
usage record.
Author: <NAME> <<EMAIL>>
Copyright: Nordic Data Grid Facility (2009, 2010)
"""
from sgas.authz import rights
class InsertChecker:
CONTEXT_KEY =... | """
Usage Records insertion checker.
Provides functionality for checking if a host should be able to insert a given
usage record.
Author: <NAME> <<EMAIL>>
Copyright: Nordic Data Grid Facility (2009, 2010)
"""
from sgas.authz import rights
class InsertChecker:
CONTEXT_KEY = None
def __init__(self, chec... | en | 0.745934 | Usage Records insertion checker. Provides functionality for checking if a host should be able to insert a given usage record. Author: <NAME> <<EMAIL>> Copyright: Nordic Data Grid Facility (2009, 2010) Given a (x509) subject identity, subject rights and a context with for the insertion, this function decides i... | 2.805139 | 3 |
psltdsim/find/findGenOnBus.py | thadhaines/PSLTDSim | 0 | 6631256 | def findGenOnBus(mirror, Busnum, Id=None, timing = True):
"""Find first generator on bus unless Id specified
Note that Ids are typically a strings i.e. '2'
"""
# TODO: remove this import
import time
if timing: tic = time.time()
#if mirror.debug: # prints a lot
# print('***Searching... | def findGenOnBus(mirror, Busnum, Id=None, timing = True):
"""Find first generator on bus unless Id specified
Note that Ids are typically a strings i.e. '2'
"""
# TODO: remove this import
import time
if timing: tic = time.time()
#if mirror.debug: # prints a lot
# print('***Searching... | en | 0.68711 | Find first generator on bus unless Id specified Note that Ids are typically a strings i.e. '2' # TODO: remove this import #if mirror.debug: # prints a lot # print('***Searching Bus %d for gen with ID %s...' %(Busnum, Id)) # Return first gen on bus if no Id # bus found # bus has machines # return first gen if No ... | 3.171308 | 3 |
docs/quickstart.py | shapiromatron/bmds-server | 1 | 6631257 | import json
import os
import time
import requests
# set the URL root to the address where BMDS server is currently running
url_root = os.environ.get("BMDS_SERVER_URL", "http://bmds-server.com")
# Create an example BMDS job. This example uses uses BMDS v2.6.0.1. with two
# dichotomous datasets:
inputs = {
"id": "... | import json
import os
import time
import requests
# set the URL root to the address where BMDS server is currently running
url_root = os.environ.get("BMDS_SERVER_URL", "http://bmds-server.com")
# Create an example BMDS job. This example uses uses BMDS v2.6.0.1. with two
# dichotomous datasets:
inputs = {
"id": "... | en | 0.913764 | # set the URL root to the address where BMDS server is currently running # Create an example BMDS job. This example uses uses BMDS v2.6.0.1. with two # dichotomous datasets: #1", # We submit the dataset to the job API: # If submission is successful, we'll get a HTTP 201 response (job # created), along with a new random... | 2.916671 | 3 |
tests/postgres_tests/__init__.py | JBKahn/django | 3 | 6631258 | <reponame>JBKahn/django<filename>tests/postgres_tests/__init__.py<gh_stars>1-10
import unittest
from django.db import connection
from django.db.backends.signals import connection_created
from django.test import TestCase
@unittest.skipUnless(connection.vendor == 'postgresql', "PostgreSQL specific tests")
class Postgr... | import unittest
from django.db import connection
from django.db.backends.signals import connection_created
from django.test import TestCase
@unittest.skipUnless(connection.vendor == 'postgresql', "PostgreSQL specific tests")
class PostgreSQLTestCase(TestCase):
@classmethod
def tearDownClass(cls):
# N... | en | 0.960956 | # No need to keep that signal overhead for non PostgreSQL-related tests. | 1.962467 | 2 |
configs/twins/twins_svt-s_fpn_fpnhead_8x4_512x512_80k_ade20k.py | rehohoho/mmsegmentation | 1 | 6631259 | _base_ = [
'../_base_/models/twins_pcpvt-s_fpn.py', '../_base_/datasets/ade20k.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
]
checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/twins/alt_gvt_small_20220308-7e1c3695.pth' # noqa
model = dict(
backbone=di... | _base_ = [
'../_base_/models/twins_pcpvt-s_fpn.py', '../_base_/datasets/ade20k.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
]
checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/twins/alt_gvt_small_20220308-7e1c3695.pth' # noqa
model = dict(
backbone=di... | none | 1 | 1.598241 | 2 | |
tests/files/md_codeblock_idem_test.py | panfill/pandoc-tables | 74 | 6631260 | <gh_stars>10-100
from logging import getLogger
from pathlib import Path
from typing import Tuple
from panflute import convert_text
from pytest import mark
from pantable.ast import PanCodeBlock
from pantable.util import parse_markdown_codeblock
logger = getLogger('pantable')
EXT = 'md'
PWD = Path(__file__).parent
DI... | from logging import getLogger
from pathlib import Path
from typing import Tuple
from panflute import convert_text
from pytest import mark
from pantable.ast import PanCodeBlock
from pantable.util import parse_markdown_codeblock
logger = getLogger('pantable')
EXT = 'md'
PWD = Path(__file__).parent
DIR = PWD / 'md_cod... | en | 0.539133 | test parsing markdown codeblock to PanCodeBlock | 2.241243 | 2 |
project/decorators.py | 18F/cloud-marketplace-prototype | 0 | 6631261 | import logging
from django.contrib.auth import REDIRECT_FIELD_NAME, decorators
from django.core.exceptions import PermissionDenied
logger = logging.getLogger('cmp')
def staff_login_required(function=None,
redirect_field_name=REDIRECT_FIELD_NAME,
login_url=None):
... | import logging
from django.contrib.auth import REDIRECT_FIELD_NAME, decorators
from django.core.exceptions import PermissionDenied
logger = logging.getLogger('cmp')
def staff_login_required(function=None,
redirect_field_name=REDIRECT_FIELD_NAME,
login_url=None):
... | en | 0.814372 | Decorator to check that the user accessing the decorated view has their is_staff flag set to True. It will first redirect to login_url or the default login url if the user is not authenticated. If the user is authenticated but is not staff, then a PermissionDenied exception will be raised. # Based off c... | 2.374164 | 2 |
nvm/pmemobj/__init__.py | isabella232/pynvm | 11 | 6631262 | <filename>nvm/pmemobj/__init__.py
from .pool import open, create, MIN_POOL_SIZE, PersistentObjectPool
from .list import PersistentList
from .dict import PersistentDict
from .object import PersistentObject
from .tuple import PersistentTuple
from .set import PersistentSet, PersistentFrozenSet
| <filename>nvm/pmemobj/__init__.py
from .pool import open, create, MIN_POOL_SIZE, PersistentObjectPool
from .list import PersistentList
from .dict import PersistentDict
from .object import PersistentObject
from .tuple import PersistentTuple
from .set import PersistentSet, PersistentFrozenSet
| none | 1 | 1.44051 | 1 | |
binder_requirements.py | whoopnip/project-report | 0 | 6631263 | import conf
if __name__ == "__main__":
for package in conf.BINDER_ENVIRONMENT_REQUIRES:
print(package)
| import conf
if __name__ == "__main__":
for package in conf.BINDER_ENVIRONMENT_REQUIRES:
print(package)
| none | 1 | 1.437693 | 1 | |
aim/sdk/init.py | VkoHov/aim | 1 | 6631264 | from aim.sdk.session import DefaultSession
def init(*args, **kwargs):
DefaultSession(*args, **kwargs)
| from aim.sdk.session import DefaultSession
def init(*args, **kwargs):
DefaultSession(*args, **kwargs)
| none | 1 | 1.472934 | 1 | |
pillcity/resources/media.py | Crystal-RainSlide/pill-city | 0 | 6631265 | import os
import boto3
import json
import werkzeug
import uuid
from typing import List
from flask_restful import reqparse, Resource, fields
from flask_jwt_extended import jwt_required, get_jwt_identity
from pillcity.models.media import Media
from pillcity.daos.media import get_media, create_media, get_media_page
from p... | import os
import boto3
import json
import werkzeug
import uuid
from typing import List
from flask_restful import reqparse, Resource, fields
from flask_jwt_extended import jwt_required, get_jwt_identity
from pillcity.models.media import Media
from pillcity.daos.media import get_media, create_media, get_media_page
from p... | en | 0.808685 | # 12 hours # Cache structure within Redis # "mediaUrl" -> object_name -> "media url"(space)"media url generated time in ms" # subtract expiry by 10 seconds for some network overhead # obtain temp token # for minio this is moot # for s3 this role allows all media read, but intersects with the inline policy, the temp rol... | 1.860667 | 2 |
crypto_duck/quack_forum/views.py | sifrovacky-cz/kachna | 0 | 6631266 | <filename>crypto_duck/quack_forum/views.py
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect, HttpResponse
from django.urls import reverse
import datetime
#form and model of normal comment
from quack_forum.forms... | <filename>crypto_duck/quack_forum/views.py
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect, HttpResponse
from django.urls import reverse
import datetime
#form and model of normal comment
from quack_forum.forms... | en | 0.893052 | #form and model of normal comment #form and model of crypto comment # saves comment and returns comment models from database #error (for unregistred user, if they do the check wrong) #checking if user is loged in # this is the part when user is not loged in # Ordering comments from oldest to newest | 2.455746 | 2 |
intcode/handlers/io/std.py | JavierLuna/intcode | 0 | 6631267 | from intcode.interfaces.io_handler import BaseIOHandler
class StdIOHandler(BaseIOHandler):
def print(self, content: str) -> None:
print(content)
def input(self) -> str:
return input()
| from intcode.interfaces.io_handler import BaseIOHandler
class StdIOHandler(BaseIOHandler):
def print(self, content: str) -> None:
print(content)
def input(self) -> str:
return input()
| none | 1 | 2.160846 | 2 | |
update_frontmatter.py | mivanit/dendron-pandoc | 7 | 6631268 | <reponame>mivanit/dendron-pandoc
from typing import *
import os
import yaml
MY_REFS : List[str] = ['../refs.bib']
def keylist_access_nested_dict(
d : Dict[str,Any],
keys : List[str],
) -> Tuple[dict,str]:
"""given a keylist `keys`, return (x,y) where x[y] is d[keys]
by pretending that `d` can be accessed do... | from typing import *
import os
import yaml
MY_REFS : List[str] = ['../refs.bib']
def keylist_access_nested_dict(
d : Dict[str,Any],
keys : List[str],
) -> Tuple[dict,str]:
"""given a keylist `keys`, return (x,y) where x[y] is d[keys]
by pretending that `d` can be accessed dotlist-style, with keys in the lis... | en | 0.754744 | given a keylist `keys`, return (x,y) where x[y] is d[keys] by pretending that `d` can be accessed dotlist-style, with keys in the list being keys to successive nested dicts, we can provide both read and write access to the element of `d` pointed to by `keys` ### Parameters: - `d : Dict[str,Any]` dict to acces... | 3.539023 | 4 |
nipype/testing/tests/test_utils.py | effigies/nipype | 0 | 6631269 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Test testing utilities
"""
import os
import warnings
import subprocess
from mock import patch, MagicMock
from nipype.testing.utils import TempFATFS
from nose.tools import assert_true, assert_raises
de... | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Test testing utilities
"""
import os
import warnings
import subprocess
from mock import patch, MagicMock
from nipype.testing.utils import TempFATFS
from nose.tools import assert_true, assert_raises
de... | en | 0.328576 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: Test testing utilities | 2.005188 | 2 |
examples/dagster_examples/airline_demo/types.py | vatervonacht/dagster | 0 | 6631270 | """Type definitions for the airline_demo."""
from collections import namedtuple
import sqlalchemy
from dagster import as_dagster_type
from dagster.core.types.dagster_type import create_string_type
AirlineDemoResources = namedtuple(
'AirlineDemoResources',
('spark', 's3', 'db_url', 'db_engine', 'db_dialect',... | """Type definitions for the airline_demo."""
from collections import namedtuple
import sqlalchemy
from dagster import as_dagster_type
from dagster.core.types.dagster_type import create_string_type
AirlineDemoResources = namedtuple(
'AirlineDemoResources',
('spark', 's3', 'db_url', 'db_engine', 'db_dialect',... | en | 0.624777 | Type definitions for the airline_demo. | 2.6634 | 3 |
dashathon/scraping/scrape_berlin_data.py | wfrierson/dashathon | 1 | 6631271 | from dashathon.scraping.scraping_methods import scrape_berlin_marathon_urls
from dashathon.scraping.scraping_methods import scrape_berlin_marathon
headers_berlin = ['year', 'bib', 'age_group', 'gender', 'country', 'rank_gender', 'rank_age_group', '5k', '10k', '15k',
'20k', 'half', '25k', '30k', '35k'... | from dashathon.scraping.scraping_methods import scrape_berlin_marathon_urls
from dashathon.scraping.scraping_methods import scrape_berlin_marathon
headers_berlin = ['year', 'bib', 'age_group', 'gender', 'country', 'rank_gender', 'rank_age_group', '5k', '10k', '15k',
'20k', 'half', '25k', '30k', '35k'... | none | 1 | 3.127021 | 3 | |
test/test_api/test_api.py | fmagin/jedi | 0 | 6631272 | <reponame>fmagin/jedi
"""
Test all things related to the ``jedi.api`` module.
"""
import os
import sys
from textwrap import dedent
import pytest
from pytest import raises
from parso import cache
from jedi._compatibility import unicode
from jedi import preload_module
from jedi.inference.gradual import typeshed
from t... | """
Test all things related to the ``jedi.api`` module.
"""
import os
import sys
from textwrap import dedent
import pytest
from pytest import raises
from parso import cache
from jedi._compatibility import unicode
from jedi import preload_module
from jedi.inference.gradual import typeshed
from test.helpers import tes... | en | 0.845072 | Test all things related to the ``jedi.api`` module. # Filter the typeshed parser cache. # +1 for None module (currently used) # compiled (c_builtin) modules shouldn't be in the cache. Script should raise a ValueError if line/column numbers are not in a valid range. # lines # columns # ok # No completions on an int ... | 2.350529 | 2 |
aws-inventory/lambda/report-accounts.py | jchrisfarris/antiope | 0 | 6631273 | <reponame>jchrisfarris/antiope
import boto3
from botocore.exceptions import ClientError
import json
import os
import time
import datetime
from mako.template import Template
from antiope.aws_account import *
from antiope.config import AccountLookupError
from common import *
import logging
logger = logging.getLogger()
... | import boto3
from botocore.exceptions import ClientError
import json
import os
import time
import datetime
from mako.template import Template
from antiope.aws_account import *
from antiope.config import AccountLookupError
from common import *
import logging
logger = logging.getLogger()
logger.setLevel(getattr(logging... | en | 0.783913 | # Lambda main routine # We will make a HTML Table and a Json file with this data # Cache account_name for all the parent accounts # Data to be saved to S3 and used to generate the template report # account_list.txt file comes from this # Get and then sort the list of accounts by name, case insensitive. # Add the accoun... | 2.116096 | 2 |
build.py | yjjnls/tesseract | 0 | 6631274 | <filename>build.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bincrafters import build_template_default
import os
if __name__ == "__main__":
builder = build_template_default.get_builder()
if os.environ.get('EMSCRIPTEN_VERSIONS'):
for version in os.environ['EMSCRIPTEN_VERSIONS'].split(','):... | <filename>build.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bincrafters import build_template_default
import os
if __name__ == "__main__":
builder = build_template_default.get_builder()
if os.environ.get('EMSCRIPTEN_VERSIONS'):
for version in os.environ['EMSCRIPTEN_VERSIONS'].split(','):... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.075203 | 2 |
techminer/co_word_analysis.py | jdvelasq/techminer-new | 1 | 6631275 | <filename>techminer/co_word_analysis.py
import matplotlib
import matplotlib.pyplot as pyplot
import numpy as np
import pandas as pd
from sklearn.manifold import MDS
import techminer.core.dashboard as dash
from techminer.core import (
CA,
DASH,
TF_matrix,
TFIDF_matrix,
add_counters_to_axis,
clus... | <filename>techminer/co_word_analysis.py
import matplotlib
import matplotlib.pyplot as pyplot
import numpy as np
import pandas as pd
from sklearn.manifold import MDS
import techminer.core.dashboard as dash
from techminer.core import (
CA,
DASH,
TF_matrix,
TFIDF_matrix,
add_counters_to_axis,
clus... | de | 0.341384 | ############################################################################### ## ## MODEL ## ############################################################################### ## ## ## Filter for cluster members ## ## ## Concept mapping ## https://tlab.it/en/allegati/help_en_online/mmappe2.htm ## ## ## Co-occurrence m... | 2.396186 | 2 |
pyplan/pyplan/common/email/classes/eEmailType.py | jorgedouglas71/pyplan-ide | 17 | 6631276 | from enum import Enum
class eEmailType(Enum):
WORKFLOW_ASSIGNED_TASK = 0
WORKFLOW_CHANGE_STATE = 1
WORKFLOW_CHANGE_PERCENT = 2
INTERFACE_COMMENT = 3
INTERFACE_REFRESH_USER_IN_COMMENT = 4 # TODO:Implement this
INTERFACE_SHARED = 5
APPLICATION_SHARED = 6
RESET_PASSWORD = 7
CHANGED_PA... | from enum import Enum
class eEmailType(Enum):
WORKFLOW_ASSIGNED_TASK = 0
WORKFLOW_CHANGE_STATE = 1
WORKFLOW_CHANGE_PERCENT = 2
INTERFACE_COMMENT = 3
INTERFACE_REFRESH_USER_IN_COMMENT = 4 # TODO:Implement this
INTERFACE_SHARED = 5
APPLICATION_SHARED = 6
RESET_PASSWORD = 7
CHANGED_PA... | en | 0.212105 | # TODO:Implement this # TODO:Implement this | 2.74657 | 3 |
video.py | rvk007/Multi-Env-Decision-Making | 2 | 6631277 | import os
import logging
import imageio
class VideoRecorder:
def __init__(self, root_dir, fps=5):
logging.getLogger('imageio_ffmpeg').setLevel(logging.ERROR)
self.save_dir = os.path.join(root_dir, 'eval_video') if root_dir else None
if self.save_dir:
os.makedirs(self.save_dir, ... | import os
import logging
import imageio
class VideoRecorder:
def __init__(self, root_dir, fps=5):
logging.getLogger('imageio_ffmpeg').setLevel(logging.ERROR)
self.save_dir = os.path.join(root_dir, 'eval_video') if root_dir else None
if self.save_dir:
os.makedirs(self.save_dir, ... | none | 1 | 2.539132 | 3 | |
container-applications/classified/inspect_workout/routes.py | emerginganalytics/ualr-cyber-gym | 3 | 6631278 | <filename>container-applications/classified/inspect_workout/routes.py
import cryptocode
from flask import Blueprint, render_template, redirect, request, url_for
from globals import ds_client, publish_status
# Blueprint Configuration
inspect_bp = Blueprint(
'inspect_bp', __name__,
url_prefix='/inspect',
tem... | <filename>container-applications/classified/inspect_workout/routes.py
import cryptocode
from flask import Blueprint, render_template, redirect, request, url_for
from globals import ds_client, publish_status
# Blueprint Configuration
inspect_bp = Blueprint(
'inspect_bp', __name__,
url_prefix='/inspect',
tem... | en | 0.431194 | # Blueprint Configuration | 2.018459 | 2 |
rdc/dic/test/test_container.py | hartym/rdc.dic | 0 | 6631279 | <gh_stars>0
from rdc.dic import Container
from rdc.dic.test import TestCase
class ContainerTestCase(TestCase):
def setUp(self):
self.container = Container()
def test_set_parameter(self):
self.assertRaises(KeyError, self.container.get, 'foo')
self.container.set_parameter('foo', 'bar')
... | from rdc.dic import Container
from rdc.dic.test import TestCase
class ContainerTestCase(TestCase):
def setUp(self):
self.container = Container()
def test_set_parameter(self):
self.assertRaises(KeyError, self.container.get, 'foo')
self.container.set_parameter('foo', 'bar')
self.... | none | 1 | 2.624074 | 3 | |
test/test_skim.py | rspencer01/skim | 3,352 | 6631280 | <reponame>rspencer01/skim
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# The integration test of skim
# Modeled after fzf's test: https://github.com/junegunn/fzf/blob/master/test/test_go.rb
import subprocess
import unittest
import os
import time
import re
import inspect
import sys
INPUT_RECORD_SEPARATOR = '\n'
DEF... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# The integration test of skim
# Modeled after fzf's test: https://github.com/junegunn/fzf/blob/master/test/test_go.rb
import subprocess
import unittest
import os
import time
import re
import inspect
import sys
INPUT_RECORD_SEPARATOR = '\n'
DEFAULT_TIMEOUT = 3000
SCRIP... | en | 0.549882 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # The integration test of skim # Modeled after fzf's test: https://github.com/junegunn/fzf/blob/master/test/test_go.rb The shell configurations for tmux tests Represent a key to send to tmux Represent a control key Represent an alt key A list that contains the output of tm... | 2.16677 | 2 |
present/markdown.py | kazukazuinaina/present | 4,252 | 6631281 | <gh_stars>1000+
# -*- coding: utf-8 -*-
import os
import warnings
import yaml
from mistune import markdown
from .slide import (
Slide,
Heading,
Paragraph,
Text,
Strong,
Codespan,
Emphasis,
Link,
List,
Image,
Codio,
BlockCode,
BlockHtml,
BlockQuote,
)
class Ma... | # -*- coding: utf-8 -*-
import os
import warnings
import yaml
from mistune import markdown
from .slide import (
Slide,
Heading,
Paragraph,
Text,
Strong,
Codespan,
Emphasis,
Link,
List,
Image,
Codio,
BlockCode,
BlockHtml,
BlockQuote,
)
class Markdown(object):
... | en | 0.764365 | # -*- coding: utf-8 -*- Parse and traverse through the markdown abstract syntax tree. | 2.633495 | 3 |
antioch/client/antioch.py | HuygensING/antioch-python-client | 0 | 6631282 | """
Copyright 2017 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... | """
Copyright 2017 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... | en | 0.837271 | Copyright 2017 <NAME> 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, softw... | 1.974482 | 2 |
LTHW/ex5.py | hectorip/ProjectsLearnPython | 0 | 6631283 | <filename>LTHW/ex5.py
# -*- coding: utf-8 -*-
my_name = '<NAME>'
my_age = 25 # not a lie
my_height = 68 # inches
my_weight = 180 # lbs
my_eyes = 'Brown'
my_teeth = 'White'
my_hair = 'Black'
print "Let's talk about %s" % my_name
print "He's %d inches tall." % my_height
print "He's %d pounds heavy." % my_weight
print ... | <filename>LTHW/ex5.py
# -*- coding: utf-8 -*-
my_name = '<NAME>'
my_age = 25 # not a lie
my_height = 68 # inches
my_weight = 180 # lbs
my_eyes = 'Brown'
my_teeth = 'White'
my_hair = 'Black'
print "Let's talk about %s" % my_name
print "He's %d inches tall." % my_height
print "He's %d pounds heavy." % my_weight
print ... | en | 0.735219 | # -*- coding: utf-8 -*- # not a lie # inches # lbs | 2.674673 | 3 |
tests/command_acceptor/user_controllerTests.py | andrii-z4i/xmind-telegram | 0 | 6631284 | from unittest import TestCase
from unittest.mock import Mock, MagicMock
from cmp_command_acceptor.app.controllers.user_controller import UserController
from cmp_command_acceptor.app.dependencies import dependencies
class UserControllerTests(TestCase):
def setUp(self):
self.queue = Mock()
depende... | from unittest import TestCase
from unittest.mock import Mock, MagicMock
from cmp_command_acceptor.app.controllers.user_controller import UserController
from cmp_command_acceptor.app.dependencies import dependencies
class UserControllerTests(TestCase):
def setUp(self):
self.queue = Mock()
depende... | none | 1 | 3.00309 | 3 | |
src/opnsense/scripts/unbound/download_blacklists.py | jdeluyck/core | 0 | 6631285 | <reponame>jdeluyck/core<filename>src/opnsense/scripts/unbound/download_blacklists.py
#!/usr/local/bin/python3
"""
Copyright (c) 2020 <NAME> <<EMAIL>>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditio... | #!/usr/local/bin/python3
"""
Copyright (c) 2020 <NAME> <<EMAIL>>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright no... | en | 0.743978 | #!/usr/local/bin/python3 Copyright (c) 2020 <NAME> <<EMAIL>> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, ... | 1.610834 | 2 |
practice/find_pivot.py | haandol/dojo | 0 | 6631286 | <reponame>haandol/dojo<filename>practice/find_pivot.py
def find_pivot(nums, lo, hi):
while lo < hi:
mid = (lo+hi)//2
if nums[hi] < nums[mid]:
lo = mid + 1
else:
hi = mid
return lo
arr = [4, 5, 6, 7, 0, 1, 2, 3]
print(find_pivot(arr, 0, len(arr)-1))
| def find_pivot(nums, lo, hi):
while lo < hi:
mid = (lo+hi)//2
if nums[hi] < nums[mid]:
lo = mid + 1
else:
hi = mid
return lo
arr = [4, 5, 6, 7, 0, 1, 2, 3]
print(find_pivot(arr, 0, len(arr)-1)) | none | 1 | 3.528704 | 4 | |
tests/ssg_test_suite/rule.py | spensireli/content | 1 | 6631287 | from __future__ import print_function
import logging
import os
import shutil
import os.path
import re
import subprocess
import collections
import json
import fnmatch
import tempfile
import contextlib
from ssg.constants import OSCAP_PROFILE, OSCAP_PROFILE_ALL_ID, OSCAP_RULE
from ssg_test_suite import oscap
from ssg_te... | from __future__ import print_function
import logging
import os
import shutil
import os.path
import re
import subprocess
import collections
import json
import fnmatch
import tempfile
import contextlib
from ssg.constants import OSCAP_PROFILE, OSCAP_PROFILE_ALL_ID, OSCAP_RULE
from ssg_test_suite import oscap
from ssg_te... | en | 0.569837 | Read datastream, and return set intersection of profiles of given benchmark and those provided in `selected_profiles` parameter. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ds="http://scap.nist.gov/schema/scap/source/1.2" xmlns:xccdf-1.2="http://checklists.nist.gov/xccdf/1.2... | 2.015163 | 2 |
set_database.py | ReadySetOdds/Thelinebacker | 0 | 6631288 | <filename>set_database.py
# import dependencies
import pymysql, json
#BESTBETS rotation, league, date, match_details, play, line, odds, play_amount
#GAME league, home_team, away_team, date, home_win, away_win, home_proj_score, away_proj_score, spread_total, home_spread_1, home_spread_2, away_spread_1, away_spread_2, ... | <filename>set_database.py
# import dependencies
import pymysql, json
#BESTBETS rotation, league, date, match_details, play, line, odds, play_amount
#GAME league, home_team, away_team, date, home_win, away_win, home_proj_score, away_proj_score, spread_total, home_spread_1, home_spread_2, away_spread_1, away_spread_2, ... | en | 0.887571 | # import dependencies #BESTBETS rotation, league, date, match_details, play, line, odds, play_amount #GAME league, home_team, away_team, date, home_win, away_win, home_proj_score, away_proj_score, spread_total, home_spread_1, home_spread_2, away_spread_1, away_spread_2, total, home_total, odds_under, away_total, odds_t... | 2.668667 | 3 |
ncaabb/game.py | aspic2/NCAABB | 1 | 6631289 | <filename>ncaabb/game.py
import random
import statistics
import csv
class Game(object):
"""Game class compares two teams ratings to determine which team is better.
The higher rated team is declared as winner and returned.
Scoring property also prints a projected score for the game.
Scoring defa... | <filename>ncaabb/game.py
import random
import statistics
import csv
class Game(object):
"""Game class compares two teams ratings to determine which team is better.
The higher rated team is declared as winner and returned.
Scoring property also prints a projected score for the game.
Scoring defa... | en | 0.976346 | Game class compares two teams ratings to determine which team is better.
The higher rated team is declared as winner and returned.
Scoring property also prints a projected score for the game.
Scoring defaults to False, as it is only used for the championship game. Winner's score is median of their season... | 4.07155 | 4 |
identify_freq_schema.py | snatch59/oecd-data-mining | 6 | 6631290 | <filename>identify_freq_schema.py
import pandas as pd
import xml.etree.ElementTree as ET
import os
# where to load or save
SCHEMA_DIR = 'OECD_schema'
DATA_DIR = 'OECD_keys'
KEY_NAMES_FILE = os.path.join(DATA_DIR, 'OECD_key_names.csv')
DATA_FILE = os.path.join(DATA_DIR, 'FREQ_key_names.csv')
# performance metrics
dat... | <filename>identify_freq_schema.py
import pandas as pd
import xml.etree.ElementTree as ET
import os
# where to load or save
SCHEMA_DIR = 'OECD_schema'
DATA_DIR = 'OECD_keys'
KEY_NAMES_FILE = os.path.join(DATA_DIR, 'OECD_key_names.csv')
DATA_FILE = os.path.join(DATA_DIR, 'FREQ_key_names.csv')
# performance metrics
dat... | en | 0.660803 | # where to load or save # performance metrics # data to be collected # Load a list of data set ids # go through each data set schema file and see if it # support the FREQUENCY or FREQ dimension for observations # print(dataset_id, 'has DataSetType') # print(val2) | 2.486446 | 2 |
tests/test_helpers.py | will-jj/arim | 14 | 6631291 | <reponame>will-jj/arim
import enum
import logging
import numpy as np
import pytest
import arim.helpers
from arim.exceptions import InvalidShape, InvalidDimension, NotAnArray
def test_get_name():
metadata = dict(long_name="Nicolas", short_name="Nic")
assert arim.helpers.get_name(metadata) == "Nicolas"
d... | import enum
import logging
import numpy as np
import pytest
import arim.helpers
from arim.exceptions import InvalidShape, InvalidDimension, NotAnArray
def test_get_name():
metadata = dict(long_name="Nicolas", short_name="Nic")
assert arim.helpers.get_name(metadata) == "Nicolas"
del metadata["long_name"... | en | 0.724837 | # 'in' statement do not change the hits/misses count: # this should do nothing # 'in' statement do not change the hits/misses count: # 1D: # 1D: # 2D dim 0: # 2D dim 1: # 3D dim 1: | 2.144009 | 2 |
ReProcess.py | ziyangz5/UCIWebSocDataAnalysis | 1 | 6631292 | <filename>ReProcess.py
import re
from collections import defaultdict
import course_database
class reprocess:
def __init__(self,text,deptname):
self.deptname = deptname
db = self.data_rough_process(text)
self.re_match(db)
self.data_process()
def data_rough_process(self,text)->{s... | <filename>ReProcess.py
import re
from collections import defaultdict
import course_database
class reprocess:
def __init__(self,text,deptname):
self.deptname = deptname
db = self.data_rough_process(text)
self.re_match(db)
self.data_process()
def data_rough_process(self,text)->{s... | en | 0.526504 | #粗处理数据,不过滤dis,该字典包括课号下所有行 #细处理数据,过滤dis,create a Course Object which contains all the lectures of this course,参数格式为[CCode,Unt,Instructor,Week,Time,Place,Final,Max,Enr,Req,Rstr,Status] #Can you do it in 1 line? | 3.241051 | 3 |
scripts/export_to_gcloud.py | khromiumos/chromiumos-chromite | 0 | 6631293 | <filename>scripts/export_to_gcloud.py<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Export entities to gcloud datastore."""
from __future__ import print_function... | <filename>scripts/export_to_gcloud.py<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Export entities to gcloud datastore."""
from __future__ import print_function... | en | 0.761217 | # -*- coding: utf-8 -*- # Copyright 2016 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Export entities to gcloud datastore. # pylint: disable=import-error # pylint: disable=import-error Creates the argparse parser. Rai... | 2.445979 | 2 |
app/routers/__init__.py | BlueJillYang/blog | 0 | 6631294 | from .contorl import contorller # this is the final controller which is controlling other apps
| from .contorl import contorller # this is the final controller which is controlling other apps
| en | 0.957275 | # this is the final controller which is controlling other apps | 1.25359 | 1 |
applied_python/applied_python/lib/python2.7/site-packages/ncclient/devices/iosxe.py | mith1979/ansible_automation | 0 | 6631295 | """
Handler for Cisco IOS-XE device specific information.
Note that for proper import, the classname has to be:
"<Devicename>DeviceHandler"
...where <Devicename> is something like "Default", "Nexus", etc.
All device-specific handlers derive from the DefaultDeviceHandler, which implements the
generic information... | """
Handler for Cisco IOS-XE device specific information.
Note that for proper import, the classname has to be:
"<Devicename>DeviceHandler"
...where <Devicename> is something like "Default", "Nexus", etc.
All device-specific handlers derive from the DefaultDeviceHandler, which implements the
generic information... | en | 0.739228 | Handler for Cisco IOS-XE device specific information. Note that for proper import, the classname has to be: "<Devicename>DeviceHandler" ...where <Devicename> is something like "Default", "Nexus", etc. All device-specific handlers derive from the DefaultDeviceHandler, which implements the generic information nee... | 2.511989 | 3 |
models.py | ECruz25/music-app-backend | 0 | 6631296 | from application import db
from sqlalchemy.dialects.postgresql import JSON
from datetime import date
class SpotifyUserSongInPlaylist(db.Model):
__tablename__ = 'spotifyusersonginplaylist'
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.String())
date_added = db.Column(db.DateTime())... | from application import db
from sqlalchemy.dialects.postgresql import JSON
from datetime import date
class SpotifyUserSongInPlaylist(db.Model):
__tablename__ = 'spotifyusersonginplaylist'
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.String())
date_added = db.Column(db.DateTime())... | none | 1 | 2.664783 | 3 | |
QRCode_generator/.env/qrcode/lib/python3.8/site-packages/pyqrcode/tables.py | Aayush3thoughtwin/nft_metaplex | 332 | 6631297 | <filename>QRCode_generator/.env/qrcode/lib/python3.8/site-packages/pyqrcode/tables.py
# -*- coding: utf-8 -*-
# Copyright (c) 2013, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * R... | <filename>QRCode_generator/.env/qrcode/lib/python3.8/site-packages/pyqrcode/tables.py
# -*- coding: utf-8 -*-
# Copyright (c) 2013, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * R... | en | 0.746835 | # -*- coding: utf-8 -*- # Copyright (c) 2013, <NAME> # 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 lis... | 1.031432 | 1 |
fluent_contents/plugins/oembeditem/content_plugins.py | jayvdb/django-fluent-contents | 0 | 6631298 | """
Definition of the plugin.
"""
import re
from fluent_contents.extensions import ContentPlugin, plugin_pool
from fluent_contents.plugins.oembeditem.models import OEmbedItem
re_safe = re.compile(r"[^\w_-]")
@plugin_pool.register
class OEmbedPlugin(ContentPlugin):
model = OEmbedItem
category = ContentPlugin... | """
Definition of the plugin.
"""
import re
from fluent_contents.extensions import ContentPlugin, plugin_pool
from fluent_contents.plugins.oembeditem.models import OEmbedItem
re_safe = re.compile(r"[^\w_-]")
@plugin_pool.register
class OEmbedPlugin(ContentPlugin):
model = OEmbedItem
category = ContentPlugin... | en | 0.719456 | Definition of the plugin. #: Custom render template Allow to style the item based on the type. | 2.377124 | 2 |
kale/queue_selector.py | ORIGINALLIFE/ndkale | 210 | 6631299 | """Module containing queue selection algorithms.
How to implement your own queue selection algorithm?
class MyQueueSelector(SelectQueueBase):
def get_queue(self):
# Get a list of all queues defined in the YAML file that is
# specified at QUEUE_CONFIG in settings file.
... | """Module containing queue selection algorithms.
How to implement your own queue selection algorithm?
class MyQueueSelector(SelectQueueBase):
def get_queue(self):
# Get a list of all queues defined in the YAML file that is
# specified at QUEUE_CONFIG in settings file.
... | en | 0.795965 | Module containing queue selection algorithms. How to implement your own queue selection algorithm? class MyQueueSelector(SelectQueueBase): def get_queue(self): # Get a list of all queues defined in the YAML file that is # specified at QUEUE_CONFIG in settings file. #... | 3.724429 | 4 |
python/helpers/epydoc/gui.py | truthiswill/intellij-community | 339 | 6631300 | <filename>python/helpers/epydoc/gui.py
#!/usr/bin/env python
#
# objdoc: epydoc command-line interface
# <NAME>
#
# Created [03/15/02 10:31 PM]
# $Id: gui.py 646 2004-03-19 19:01:37Z edloper $
#
"""
Graphical interface to epydoc. This interface might be useful for
systems where it's inconvenient to use the command-li... | <filename>python/helpers/epydoc/gui.py
#!/usr/bin/env python
#
# objdoc: epydoc command-line interface
# <NAME>
#
# Created [03/15/02 10:31 PM]
# $Id: gui.py 646 2004-03-19 19:01:37Z edloper $
#
"""
Graphical interface to epydoc. This interface might be useful for
systems where it's inconvenient to use the command-li... | en | 0.343344 | #!/usr/bin/env python # # objdoc: epydoc command-line interface # <NAME> # # Created [03/15/02 10:31 PM] # $Id: gui.py 646 2004-03-19 19:01:37Z edloper $ # Graphical interface to epydoc. This interface might be useful for systems where it's inconvenient to use the command-line interface (such as Windows). It supports... | 2.403937 | 2 |
python/paddle/fluid/tests/unittests/dygraph_to_static/test_dict.py | TochkaAI/Paddle | 3 | 6631301 | # Copyright (c) 2020 PaddlePaddle 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 appli... | # Copyright (c) 2020 PaddlePaddle 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 appli... | en | 0.789072 | # Copyright (c) 2020 PaddlePaddle 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 appli... | 2.001274 | 2 |
example/bulk.py | loevlie/ce_expansion | 1 | 6631302 | <filename>example/bulk.py<gh_stars>1-10
import os
import numpy as np
from ce_expansion.atomgraph import atomgraph
from ce_expansion.npdb import db_inter
# GLOBAL fontsize of axis labels and text
FS = 40
shape = ['icosahedron', 'cuboctahedron',
'elongated-pentagonal-bipyramid', 'fcc-cube'][0]
metals = 'aucu... | <filename>example/bulk.py<gh_stars>1-10
import os
import numpy as np
from ce_expansion.atomgraph import atomgraph
from ce_expansion.npdb import db_inter
# GLOBAL fontsize of axis labels and text
FS = 40
shape = ['icosahedron', 'cuboctahedron',
'elongated-pentagonal-bipyramid', 'fcc-cube'][0]
metals = 'aucu... | en | 0.798014 | # GLOBAL fontsize of axis labels and text # number of shells on inside and outside to ignore in calculation # get number of atoms # get half such that metal1 has the extra atom (if natoms is odd) # get ordering array # load bonds list # build atomgraph object # get atom indices for each shell # create a 'Test Atom' to ... | 2.331858 | 2 |
Documentation/GuidesFromPlosCompBioPaper/ExampleCaseC/AdditionalInputFiles/PRSCondition/LAD2coronaryRdController.py | carthurs/CRIMSONGUI | 10 | 6631303 | version https://git-lfs.github.com/spec/v1
oid sha256:61bea305f96063c5fb171c13e8b1ca15cae0d5682a9a7b4ecc29798ff2741fbd
size 11919
| version https://git-lfs.github.com/spec/v1
oid sha256:61bea305f96063c5fb171c13e8b1ca15cae0d5682a9a7b4ecc29798ff2741fbd
size 11919
| none | 1 | 0.765739 | 1 | |
proj/pred/app/archive_logfile.py | kant/predictprotein-webserver-proq3 | 0 | 6631304 | #!/usr/bin/python
# Filename: archive_logfile.py
# Description: archive logfile using gnu gzip
import os
import sys
import re
import gzip
progname = os.path.basename(sys.argv[0])
wspace = ''.join([" "]*len(progname))
usage_short="""
Usage: %s FILE [FILE ...] [-maxsize STR]
"""%(progname)
usage_ext="""
Description:
... | #!/usr/bin/python
# Filename: archive_logfile.py
# Description: archive logfile using gnu gzip
import os
import sys
import re
import gzip
progname = os.path.basename(sys.argv[0])
wspace = ''.join([" "]*len(progname))
usage_short="""
Usage: %s FILE [FILE ...] [-maxsize STR]
"""%(progname)
usage_ext="""
Description:
... | en | 0.44535 | #!/usr/bin/python # Filename: archive_logfile.py # Description: archive logfile using gnu gzip Usage: %s FILE [FILE ...] [-maxsize STR] Description: Archive (gzip) the logfile if its size is over maxsize OPTIONS: -l LISTFILE List of log files -maxsize STR Set the threshold of the filesize, the logfile will ... | 3.069352 | 3 |
python/client/azure/mgmt/redhatopenshift/v2020_10_31_preview/_azure_red_hat_open_shift_client.py | dkorzuno/ARO-RP | 0 | 6631305 | <filename>python/client/azure/mgmt/redhatopenshift/v2020_10_31_preview/_azure_red_hat_open_shift_client.py<gh_stars>0
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. All rights reserved.
#
# Licensed under the Apache License, Versi... | <filename>python/client/azure/mgmt/redhatopenshift/v2020_10_31_preview/_azure_red_hat_open_shift_client.py<gh_stars>0
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. All rights reserved.
#
# Licensed under the Apache License, Versi... | en | 0.626722 | # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft and contributors. 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 ... | 1.409257 | 1 |
docs/notebooks/active_learning.pct.py | ChrisMorter/trieste | 0 | 6631306 | <reponame>ChrisMorter/trieste
# %% [markdown]
# # Active Learning
# %% [markdown]
# Sometimes, we may just want to learn a black-box function, rather than optimizing it. This goal is known as active learning and corresponds to choosing query points that reduce our model uncertainty. This notebook demonstrates how to p... | # %% [markdown]
# # Active Learning
# %% [markdown]
# Sometimes, we may just want to learn a black-box function, rather than optimizing it. This goal is known as active learning and corresponds to choosing query points that reduce our model uncertainty. This notebook demonstrates how to perform Bayesian active learnin... | en | 0.861726 | # %% [markdown] # # Active Learning # %% [markdown] # Sometimes, we may just want to learn a black-box function, rather than optimizing it. This goal is known as active learning and corresponds to choosing query points that reduce our model uncertainty. This notebook demonstrates how to perform Bayesian active learning... | 3.188941 | 3 |
euler5.py | G00364756/Programming_Exercises | 0 | 6631307 | <reponame>G00364756/Programming_Exercises
# <NAME> - G00364756 - 22/02/2018
# Exercise 4, Topic 4: euler5.py
# Project Euler_Problem 5:
# 2520 is the smallest number that can be divided by
# each of the numbers from 1 to 10 without any remainder.
# What is the smallest positive number that is evenly
# divisible... | # <NAME> - G00364756 - 22/02/2018
# Exercise 4, Topic 4: euler5.py
# Project Euler_Problem 5:
# 2520 is the smallest number that can be divided by
# each of the numbers from 1 to 10 without any remainder.
# What is the smallest positive number that is evenly
# divisible by all of the numbers from 1 to 20?
# ... | en | 0.948493 | # <NAME> - G00364756 - 22/02/2018 # Exercise 4, Topic 4: euler5.py # Project Euler_Problem 5: # 2520 is the smallest number that can be divided by # each of the numbers from 1 to 10 without any remainder. # What is the smallest positive number that is evenly # divisible by all of the numbers from 1 to 20? # This code i... | 3.712294 | 4 |
python/764.largest-plus-sign.py | stavanmehta/leetcode | 0 | 6631308 | <reponame>stavanmehta/leetcode
class Solution:
def orderOfLargestPlusSign(self, N: int, mines: List[List[int]]) -> int:
| class Solution:
def orderOfLargestPlusSign(self, N: int, mines: List[List[int]]) -> int: | none | 1 | 2.079668 | 2 | |
mywork/adult_income.py | qiudebo/13learn | 1 | 6631309 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from pyspark.sql import SparkSession
spark = SparkSession.builder.appName("python Spark SQL basic adult")\
.config("spark.some.config.option", "some-value")\
.getOrCreate()
df = spark.read.text("/Users/qiudebo/PycharmProjects/stanford_cs231/spark_example/data/adult... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from pyspark.sql import SparkSession
spark = SparkSession.builder.appName("python Spark SQL basic adult")\
.config("spark.some.config.option", "some-value")\
.getOrCreate()
df = spark.read.text("/Users/qiudebo/PycharmProjects/stanford_cs231/spark_example/data/adult... | en | 0.44423 | #!/usr/bin/python # -*- coding: utf-8 -*- | 3.181182 | 3 |
tests/test.py | Confy255/group3predict | 1 | 6631310 | from . import ourmodule | from . import ourmodule | none | 1 | 1.198964 | 1 | |
blog/views.py | jeanlucancey/pronunciamento | 0 | 6631311 | from django.shortcuts import (
get_object_or_404, redirect, render)
from django.views.decorators.http import \
require_http_methods
from django.views.generic import View
from .forms import PostForm
from .models import Post
class PostCreate(View):
form_class = PostForm
template_name = 'blog/post_form.... | from django.shortcuts import (
get_object_or_404, redirect, render)
from django.views.decorators.http import \
require_http_methods
from django.views.generic import View
from .forms import PostForm
from .models import Post
class PostCreate(View):
form_class = PostForm
template_name = 'blog/post_form.... | none | 1 | 2.122144 | 2 | |
ticker.py | reaganking/Ticker | 0 | 6631312 | <filename>ticker.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''show scores of today's NHL games'''
import datetime
import json
import os
import platform
import sys
import time
import requests
from colorama import init, Fore, Style
from pytz import reference
# API purportedly updates every 60 seconds
REFRESH_TI... | <filename>ticker.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''show scores of today's NHL games'''
import datetime
import json
import os
import platform
import sys
import time
import requests
from colorama import init, Fore, Style
from pytz import reference
# API purportedly updates every 60 seconds
REFRESH_TI... | en | 0.805939 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- show scores of today's NHL games # API purportedly updates every 60 seconds generates a scoreboard of today's NHL games # Today's date # Yesterday's date # Convert the scraped page to text and trim # Create JSON object # extract useful info from JSON # Show today's games #... | 2.94339 | 3 |
simulation/utils/machine_learning/cycle_gan/image_translator.py | KITcar-Team/kitcar-gazebo-simulation | 13 | 6631313 | import argparse
import os
import pathlib
import cv2
import numpy as np
import torch
from PIL import Image
from simulation.utils.machine_learning.data.base_dataset import get_transform
from simulation.utils.machine_learning.data.image_operations import tensor2im
from simulation.utils.machine_learning.models import res... | import argparse
import os
import pathlib
import cv2
import numpy as np
import torch
from PIL import Image
from simulation.utils.machine_learning.data.base_dataset import get_transform
from simulation.utils.machine_learning.data.image_operations import tensor2im
from simulation.utils.machine_learning.models import res... | en | 0.83975 | Implementation of a simple ROS interface to translate simulated to "real" images. Initialize the ImageTranslator class. Use default test options but could be via command-line. Load and setup the model Translate an image to a "fake real" image by using the loaded model. Args: image: Image t... | 2.25051 | 2 |
src/cnn_class2/tf_resnet_first_layers.py | JouniVatanen/NLP-and-Deep-Learning | 1 | 6631314 | # https://deeplearningcourses.com/c/advanced-computer-vision
# https://www.udemy.com/advanced-computer-vision
from __future__ import print_function, division
from builtins import range, input
# Note: you may need to update your version of future
# sudo pip install -U future
# Let's go up to the end of the first conv ... | # https://deeplearningcourses.com/c/advanced-computer-vision
# https://www.udemy.com/advanced-computer-vision
from __future__ import print_function, division
from builtins import range, input
# Note: you may need to update your version of future
# sudo pip install -U future
# Let's go up to the end of the first conv ... | en | 0.710429 | # https://deeplearningcourses.com/c/advanced-computer-vision # https://www.udemy.com/advanced-computer-vision # Note: you may need to update your version of future # sudo pip install -U future # Let's go up to the end of the first conv block # to make sure everything has been loaded correctly # compared to keras # NOTE... | 2.954269 | 3 |
configs/deepim/lmPbrSO/FlowNet512_1.5AugCosyAAEGray_Flat_lmPbr_SO/FlowNet512_1.5AugCosyAAEGray_Flat_Pbr_11_glue.py | THU-DA-6D-Pose-Group/self6dpp | 33 | 6631315 | <gh_stars>10-100
_base_ = ["./FlowNet512_1.5AugCosyAAEGray_Flat_Pbr_01_ape.py"]
OUTPUT_DIR = "output/deepim/lmPbrSO/FlowNet512_1.5AugCosyAAEGray_Flat_lmPbr_SO/glue"
DATASETS = dict(TRAIN=("lm_pbr_glue_train",), TEST=("lm_real_glue_test",))
# bbnc9
# objects glue Avg(1)
# ad_2 20.95 20.95
# ad_5 59.46 5... | _base_ = ["./FlowNet512_1.5AugCosyAAEGray_Flat_Pbr_01_ape.py"]
OUTPUT_DIR = "output/deepim/lmPbrSO/FlowNet512_1.5AugCosyAAEGray_Flat_lmPbr_SO/glue"
DATASETS = dict(TRAIN=("lm_pbr_glue_train",), TEST=("lm_real_glue_test",))
# bbnc9
# objects glue Avg(1)
# ad_2 20.95 20.95
# ad_5 59.46 59.46
# ad_10 8... | en | 0.399192 | # bbnc9 # objects glue Avg(1) # ad_2 20.95 20.95 # ad_5 59.46 59.46 # ad_10 89.58 89.58 # rete_2 5.79 5.79 # rete_5 70.17 70.17 # rete_10 97.30 97.30 # re_2 8.11 8.11 # re_5 73.46 73.46 # re_10 97.39 97.39 # te_2 62.64 62.64 # te_5 94.31 94.31 # te_10 99.81 99.81 #... | 1.457994 | 1 |
async_v20/endpoints/annotations.py | gshklover/async_v20 | 23 | 6631316 | <reponame>gshklover/async_v20<gh_stars>10-100
from ..definitions.types import ClientExtensions
from ..definitions.primitives import InstrumentName
from ..definitions.types import TransactionID
from ..definitions.types import DateTime
__all__ = ['Alias', 'AlignmentTimezone', 'Authorization', 'Count', 'DailyAlignment', ... | from ..definitions.types import ClientExtensions
from ..definitions.primitives import InstrumentName
from ..definitions.types import TransactionID
from ..definitions.types import DateTime
__all__ = ['Alias', 'AlignmentTimezone', 'Authorization', 'Count', 'DailyAlignment', 'FromTime',
'FromTransactionID', 'I... | en | 0.845138 | Contains OANDA's v20 API authorization token The number of candlesticks to return in the reponse. Count should not be specified if both the start and end parameters are provided, as the time range combined with the graularity will determine the number of candlesticks to return. [default=500, maximum=500... | 2.31923 | 2 |
pygpsnmea/gui/positionstab.py | tww-software/py_gps_nmea | 0 | 6631317 | <gh_stars>0
"""
tab to display a table of all the positions we have recorded
"""
import tkinter
class PosRepTab(tkinter.ttk.Frame):
"""
tab to display all the NMEA Sentences and descriptions + times
Note:
basically a tab with a table inside
Args:
tabcontrol(tkinter.ttk.Notebook): tt... | """
tab to display a table of all the positions we have recorded
"""
import tkinter
class PosRepTab(tkinter.ttk.Frame):
"""
tab to display all the NMEA Sentences and descriptions + times
Note:
basically a tab with a table inside
Args:
tabcontrol(tkinter.ttk.Notebook): ttk notebook t... | en | 0.603557 | tab to display a table of all the positions we have recorded tab to display all the NMEA Sentences and descriptions + times Note: basically a tab with a table inside Args: tabcontrol(tkinter.ttk.Notebook): ttk notebook to add this tab to Attributes: autoscroll(tkinter.BooleanVar):... | 3.243286 | 3 |
loam/cli.py | amorison/loam | 0 | 6631318 | <reponame>amorison/loam
"""Definition of CLI manager."""
from __future__ import annotations
from dataclasses import fields
import argparse
import copy
import pathlib
import typing
import warnings
from types import MappingProxyType
from . import error, _internal
if typing.TYPE_CHECKING:
from typing import Dict, Li... | """Definition of CLI manager."""
from __future__ import annotations
from dataclasses import fields
import argparse
import copy
import pathlib
import typing
import warnings
from types import MappingProxyType
from . import error, _internal
if typing.TYPE_CHECKING:
from typing import Dict, List, Any, Optional, Mappi... | en | 0.784835 | Definition of CLI manager. # cutting line in scripts List of cli strings for a given option. Metadata of sub commands. Attributes: help: short description of the sub command. sections: configuration sections used by the subcommand. defaults: default value of options associated to the subcom... | 2.537518 | 3 |
tests/app/test_schemas.py | cds-snc/notifier-api | 41 | 6631319 | <gh_stars>10-100
import pytest
from marshmallow import ValidationError
from sqlalchemy import desc
from app.dao.provider_details_dao import dao_update_provider_details
from app.models import ProviderDetailsHistory
from tests.app.db import create_api_key
def test_job_schema_doesnt_return_notifications(sample_notifica... | import pytest
from marshmallow import ValidationError
from sqlalchemy import desc
from app.dao.provider_details_dao import dao_update_provider_details
from app.models import ProviderDetailsHistory
from tests.app.db import create_api_key
def test_job_schema_doesnt_return_notifications(sample_notification_with_job):
... | none | 1 | 2.079191 | 2 | |
chat/tests_apps.py | helmetwearer/dating-app | 0 | 6631320 | <filename>chat/tests_apps.py
from django.apps import apps
from django.test import TestCase
from .apps import ChatConfig
class test_chatconfig(TestCase):
def test_app(self):
self.assertEqual("chat", ChatConfig.name)
self.assertEqual("chat", apps.get_app_config("chat").name) | <filename>chat/tests_apps.py
from django.apps import apps
from django.test import TestCase
from .apps import ChatConfig
class test_chatconfig(TestCase):
def test_app(self):
self.assertEqual("chat", ChatConfig.name)
self.assertEqual("chat", apps.get_app_config("chat").name) | none | 1 | 2.162179 | 2 | |
server.py | Ailol/Simple-FTP-server | 1 | 6631321 | <filename>server.py<gh_stars>1-10
import argparse
import os
from network.sftp import Sftp
class Server(object):
"""
Simple server implementation
SFTP holds all the magic
Starts the server up by arguments given by the user.
"""
def __init__(self, *args):
try:
... | <filename>server.py<gh_stars>1-10
import argparse
import os
from network.sftp import Sftp
class Server(object):
"""
Simple server implementation
SFTP holds all the magic
Starts the server up by arguments given by the user.
"""
def __init__(self, *args):
try:
... | en | 0.657727 | Simple server implementation SFTP holds all the magic Starts the server up by arguments given by the user. | 3.479287 | 3 |
Face_Enhancement/models/networks/__init__.py | abdullahselek/Bringing-Old-Photos-Back-to-Life | 1 | 6631322 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import torch
from models.networks.base_network import BaseNetwork
from models.networks.generator import *
from models.networks.encoder import *
import util.util as util
def find_network_using_name(target_network_name, filename):
target_clas... | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import torch
from models.networks.base_network import BaseNetwork
from models.networks.generator import *
from models.networks.encoder import *
import util.util as util
def find_network_using_name(target_network_name, filename):
target_clas... | en | 0.764855 | # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # there exists only one encoder type | 2.156622 | 2 |
contrib/cli_scripts/pe_console_group_to_nm.py | coxmediagroup/nodemeister | 0 | 6631323 | #!/usr/bin/env python
"""
Script to migrate a group, along with its classes and
parameters (but not nodes, parents, or child groups)
from Puppet Enterprise Console (or Dashboard?) to
NodeMeister.
Since Console/Dashboard doesn't have a real API, this
directly accesses the MySQL database.
"""
import MySQLdb
import MyS... | #!/usr/bin/env python
"""
Script to migrate a group, along with its classes and
parameters (but not nodes, parents, or child groups)
from Puppet Enterprise Console (or Dashboard?) to
NodeMeister.
Since Console/Dashboard doesn't have a real API, this
directly accesses the MySQL database.
"""
import MySQLdb
import MyS... | en | 0.741592 | #!/usr/bin/env python Script to migrate a group, along with its classes and parameters (but not nodes, parents, or child groups) from Puppet Enterprise Console (or Dashboard?) to NodeMeister. Since Console/Dashboard doesn't have a real API, this directly accesses the MySQL database. # I don't like positional refs in ... | 2.700965 | 3 |
rmgpy/rmg/inputTest.py | speth/RMG-Py | 1 | 6631324 | <reponame>speth/RMG-Py<filename>rmgpy/rmg/inputTest.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | en | 0.586151 | #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # # # RMG - Reaction Mechanism Generator # # ... | 1.675696 | 2 |
plib/leds.py | slowrunner/GoPiLgc | 0 | 6631325 | #!/usr/bin/python3
# File: leds.py
#
# Methods:
# leds.all_on(egpg) turn two red blinker leds on and two "eyes" on bright white
# leds.all_off(egpg) turn two red blinker leds off and two "eyes" off
# wifi_blinker_on(egpg,color=RED) make wifi led blink on/off,on/off...
# pass colors as leds.YELLOW or l... | #!/usr/bin/python3
# File: leds.py
#
# Methods:
# leds.all_on(egpg) turn two red blinker leds on and two "eyes" on bright white
# leds.all_off(egpg) turn two red blinker leds off and two "eyes" off
# wifi_blinker_on(egpg,color=RED) make wifi led blink on/off,on/off...
# pass colors as leds.YELLOW or l... | en | 0.621432 | #!/usr/bin/python3 # File: leds.py # # Methods: # leds.all_on(egpg) turn two red blinker leds on and two "eyes" on bright white # leds.all_off(egpg) turn two red blinker leds off and two "eyes" off # wifi_blinker_on(egpg,color=RED) make wifi led blink on/off,on/off... # pass colors as leds.YELLOW or led... | 3.437557 | 3 |
aispace/models/question_answer/bento_services/bert_for_qa_with_impossible_service.py | SmileGoat/AiSpace | 32 | 6631326 | <gh_stars>10-100
# !/usr/bin/env python
# coding=utf-8
# @Time : 2020/4/25 18:08
# @Author : <EMAIL>
# @File : bert_for_qa_service.py
__all__ = [
"BertQAWithImpossibleService"
]
import os, sys
from collections import defaultdict
import tensorflow as tf
from copy import deepcopy
sys.path.insert(0, os.path... | # !/usr/bin/env python
# coding=utf-8
# @Time : 2020/4/25 18:08
# @Author : <EMAIL>
# @File : bert_for_qa_service.py
__all__ = [
"BertQAWithImpossibleService"
]
import os, sys
from collections import defaultdict
import tensorflow as tf
from copy import deepcopy
sys.path.insert(0, os.path.abspath(os.path.... | en | 0.744612 | # !/usr/bin/env python # coding=utf-8 # @Time : 2020/4/25 18:08 # @Author : <EMAIL> # @File : bert_for_qa_service.py # if question_text == "" or para_text == "": # unique_id = uuid_maker() # question_text = question_text.lower() # query_tokens = self.artifacts.tokenizer.tokenize(question_text) # query_tokens = q... | 1.996545 | 2 |
full_cost/full_cost/utils/facturing.py | CEMES-CNRS/full_cost_git | 0 | 6631327 | import importlib
import os
import datetime
from openpyxl import load_workbook, utils
from django.db.models import Q
from openpyxl.styles import Border, Side, Alignment, Font
from openpyxl.utils.cell import get_column_letter
from io import BytesIO
import numpy as np
from datetime import date
from django.http import Http... | import importlib
import os
import datetime
from openpyxl import load_workbook, utils
from django.db.models import Q
from openpyxl.styles import Border, Side, Alignment, Font
from openpyxl.utils.cell import get_column_letter
from io import BytesIO
import numpy as np
from datetime import date
from django.http import Http... | none | 1 | 2.056441 | 2 | |
datafiles/tests/test_mapper.py | jacebrowning/datafiles | 151 | 6631328 | # pylint: disable=unused-variable
import platform
from dataclasses import dataclass
from pathlib import Path
import pytest
from datafiles.config import Meta
from datafiles.mapper import Mapper, create_mapper
@dataclass
class MyClass:
foobar: int
class MyField:
@classmethod
def to_preserialization_dat... | # pylint: disable=unused-variable
import platform
from dataclasses import dataclass
from pathlib import Path
import pytest
from datafiles.config import Meta
from datafiles.mapper import Mapper, create_mapper
@dataclass
class MyClass:
foobar: int
class MyField:
@classmethod
def to_preserialization_dat... | en | 0.542122 | # pylint: disable=unused-variable | 2.047433 | 2 |
code-example/ch03/vowels3.py | grahovsky/python-edu | 0 | 6631329 | <filename>code-example/ch03/vowels3.py
vowels = ['a', 'e', 'i', 'o', 'u']
word = input("Provide a word to search for vowels: ")
found = {}
for letter in word:
if letter in vowels:
found.setdefault(letter, 0)
found[letter] += 1
for vowel in sorted(found):
print(vowel, 'occurred', found... | <filename>code-example/ch03/vowels3.py
vowels = ['a', 'e', 'i', 'o', 'u']
word = input("Provide a word to search for vowels: ")
found = {}
for letter in word:
if letter in vowels:
found.setdefault(letter, 0)
found[letter] += 1
for vowel in sorted(found):
print(vowel, 'occurred', found... | none | 1 | 4.138385 | 4 | |
evaluation/evaluate_text_classification.py | dyrson11/NL-Augmenter | 0 | 6631330 | from tasks.TaskTypes import TaskType
import numpy as np
import enum
from datasets import load_dataset
from transformers import pipeline
from dataset import TextLineDataset, KeyValueDataset
import torch
# make this to work for three task.
class SENTIMENT_LABELS(enum.Enum):
NEGATIVE = 0
POSITIVE = 1
class ... | from tasks.TaskTypes import TaskType
import numpy as np
import enum
from datasets import load_dataset
from transformers import pipeline
from dataset import TextLineDataset, KeyValueDataset
import torch
# make this to work for three task.
class SENTIMENT_LABELS(enum.Enum):
NEGATIVE = 0
POSITIVE = 1
class ... | en | 0.783627 | # make this to work for three task. # (3) Execute perturbation # (4) Execute the performance of the original set and the perturbed set # For the roberta_chinese_base model, you have to call the tokenizer for BERT instead: # https://huggingface.co/clue/roberta_chinese_base # (3) Execute perturbation # (4) Execute the pe... | 2.521698 | 3 |
tinder_py/tinder/entities/update.py | hc5aleksandrov/autotinder | 0 | 6631331 | <reponame>hc5aleksandrov/autotinder
from typing import List
class NewMessage:
"""
Container for a new message holding the message and match id.
"""
__slots__ = ["message_id", "match_id"]
def __init__(self, message_id: str, match_id: str):
self.message_id: str = message_id
... | from typing import List
class NewMessage:
"""
Container for a new message holding the message and match id.
"""
__slots__ = ["message_id", "match_id"]
def __init__(self, message_id: str, match_id: str):
self.message_id: str = message_id
self.match_id: str = match_id
... | en | 0.673338 | Container for a new message holding the message and match id. Describes an update sent by Tinder containing information about new matches and messages. A list of all new matches A list of all new messages The raw update event response | 3.289851 | 3 |
string/solution/1316.py | gpgun0/baekjoon_ | 0 | 6631332 | <gh_stars>0
class Solution:
def main(self, word: str) -> int:
char_check_list = [0] * 26
char_check_list[ord(word[0]) - 97] = 1
for i in range(1, len(word)):
if char_check_list[ord(word[i]) - 97] and word[i-1] != word[i]:
return 0
char_check_l... | class Solution:
def main(self, word: str) -> int:
char_check_list = [0] * 26
char_check_list[ord(word[0]) - 97] = 1
for i in range(1, len(word)):
if char_check_list[ord(word[i]) - 97] and word[i-1] != word[i]:
return 0
char_check_list[ord(word... | none | 1 | 3.238958 | 3 | |
GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py | AndrissP/cmssw | 0 | 6631333 | <filename>GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py
import FWCore.ParameterSet.Config as cms
import sys
process = cms.Process("TEST")
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(10))
from GeneratorInterface.Core.ExternalGeneratorF... | <filename>GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py
import FWCore.ParameterSet.Config as cms
import sys
process = cms.Process("TEST")
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(10))
from GeneratorInterface.Core.ExternalGeneratorF... | none | 1 | 1.673215 | 2 | |
tests/test_corpus.py | zhouyangnk/Montreal-Forced-Aligner | 1 | 6631334 | <filename>tests/test_corpus.py
import os
import sys
import pytest
import shutil
from aligner.corpus import Corpus
from aligner.dictionary import Dictionary
from aligner.features.config import FeatureConfig
def test_basic(basic_dict_path, basic_corpus_dir, generated_dir):
dictionary = Dictionary(basic_dict_path, ... | <filename>tests/test_corpus.py
import os
import sys
import pytest
import shutil
from aligner.corpus import Corpus
from aligner.dictionary import Dictionary
from aligner.features.config import FeatureConfig
def test_basic(basic_dict_path, basic_corpus_dir, generated_dir):
dictionary = Dictionary(basic_dict_path, ... | none | 1 | 2.247202 | 2 | |
saleor/product/migrations/0059_generate_variant_name_from_attrs.py | TysonRV/saleor | 9 | 6631335 | <reponame>TysonRV/saleor
# Generated by Django 2.0.2 on 2018-03-11 18:54
from django.db import migrations
from saleor.product.utils.attributes import get_attributes_display_map
def get_name_from_attributes(variant):
attributes = variant.product.product_type.variant_attributes.all()
values = get_attributes_di... | # Generated by Django 2.0.2 on 2018-03-11 18:54
from django.db import migrations
from saleor.product.utils.attributes import get_attributes_display_map
def get_name_from_attributes(variant):
attributes = variant.product.product_type.variant_attributes.all()
values = get_attributes_display_map(variant, attrib... | en | 0.845188 | # Generated by Django 2.0.2 on 2018-03-11 18:54 | 2.11269 | 2 |
classical/__init__.py | JosephGesnouin/Asymmetrical-Bi-RNNs-to-encode-pedestrian-trajectories | 9 | 6631336 | from .socialforce import predict
from .orca import predict
from .kalman import predict
from .constant_velocity import predict
| from .socialforce import predict
from .orca import predict
from .kalman import predict
from .constant_velocity import predict
| none | 1 | 0.964587 | 1 | |
signac/contrib/migration/__init__.py | rohanbabbar04/signac | 0 | 6631337 | <gh_stars>0
# Copyright (c) 2019 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
"""Handle migrations of signac schema versions."""
import os
import sys
from filelock import FileLock
from packaging import version
from ...version import SCHE... | # Copyright (c) 2019 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
"""Handle migrations of signac schema versions."""
import os
import sys
from filelock import FileLock
from packaging import version
from ...version import SCHEMA_VERSION, ... | en | 0.845021 | # Copyright (c) 2019 The Regents of the University of Michigan # All rights reserved. # This software is licensed under the BSD 3-Clause License. Handle migrations of signac schema versions. # Config loaders must be functions with the signature # def config_loader(root_directory: str) -> MutableMapping # When a new sch... | 1.917509 | 2 |
imcsdk/mometa/firmware/FirmwareRunning.py | kgrozis/UCS-CIMC-Scripts | 0 | 6631338 | """This module contains the general information for FirmwareRunning ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import ImcVersion, MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class FirmwareRunningConsts():
DEPLOYMENT_BOOT_LOADER = "boot-loader"
DEPLOYMENT_KERNEL = "... | """This module contains the general information for FirmwareRunning ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import ImcVersion, MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class FirmwareRunningConsts():
DEPLOYMENT_BOOT_LOADER = "boot-loader"
DEPLOYMENT_KERNEL = "... | en | 0.731699 | This module contains the general information for FirmwareRunning ManagedObject. This is FirmwareRunning class. ((removed|created|modified|deleted),){0,3}(removed|created|modified|deleted){0,1} | 1.932418 | 2 |
ReinforcedPy/__init__.py | ZibraMax/NSR10-design | 0 | 6631339 | <reponame>ZibraMax/NSR10-design<gh_stars>0
from .Elemento import *
from .Material import *
from .Concreto import *
from .AceroRefuerzo import *
from .Varilla import *
from .Seccion import *
| from .Elemento import *
from .Material import *
from .Concreto import *
from .AceroRefuerzo import *
from .Varilla import *
from .Seccion import * | none | 1 | 1.115751 | 1 | |
tests/testdata/deploy_scripts/builtin/invalid_metadata.py | horus-view-and-explore/horus-deploy | 3 | 6631340 | <filename>tests/testdata/deploy_scripts/builtin/invalid_metadata.py<gh_stars>1-10
name = "invalid"
METADATA = {"name": name}
| <filename>tests/testdata/deploy_scripts/builtin/invalid_metadata.py<gh_stars>1-10
name = "invalid"
METADATA = {"name": name}
| none | 1 | 1.20522 | 1 | |
scripts/imgviewer_conversions.py | akashdhamasia/Facial-keypoints-recognition-using-CNN | 184 | 6631341 | # -*- coding: utf-8 -*-
'''
Conversion functions for image viewer extension
'''
import cv2
import six
import numpy as np
import drawing
# logging
from logging import getLogger, NullHandler
logger = getLogger(__name__)
logger.addHandler(NullHandler())
def face_img_func(key, entry, viewer):
# Image conversion
... | # -*- coding: utf-8 -*-
'''
Conversion functions for image viewer extension
'''
import cv2
import six
import numpy as np
import drawing
# logging
from logging import getLogger, NullHandler
logger = getLogger(__name__)
logger.addHandler(NullHandler())
def face_img_func(key, entry, viewer):
# Image conversion
... | en | 0.718661 | # -*- coding: utf-8 -*- Conversion functions for image viewer extension # logging # Image conversion # Use only a first data in the batch # for safety # [-0.5:0.5] -> [0:1] # Draw # accumulate to 3 channels image # normalize # ========================= Loss Graph (In a tab page) ======================== # Get a log # C... | 2.809927 | 3 |
stolen_sugar/populate.py | daslater/knausj_talon | 0 | 6631342 | import boto3
import code.keys
from code.keys import ctx as ctx_keys
items_to_write = []
filename = code.keys.__file__.removeprefix('/Users/austin/Code/talon/')
for (category, mappings) in ctx_keys.lists.items():
category = category.removeprefix('self.')
context = ctx_keys.matches if hasattr(ctx_keys, 'matches'... | import boto3
import code.keys
from code.keys import ctx as ctx_keys
items_to_write = []
filename = code.keys.__file__.removeprefix('/Users/austin/Code/talon/')
for (category, mappings) in ctx_keys.lists.items():
category = category.removeprefix('self.')
context = ctx_keys.matches if hasattr(ctx_keys, 'matches'... | none | 1 | 2.207919 | 2 | |
bin/enREST.py | ubercomrade/enrest | 0 | 6631343 | import os
import sys
import argparse
from enrest.functions import *
from enrest.set import set_case
from enrest.deg import deg_case
from enrest.fasta import fasta_case
def parse_args():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='subparser_name', help='Available commands:')
... | import os
import sys
import argparse
from enrest.functions import *
from enrest.set import set_case
from enrest.deg import deg_case
from enrest.fasta import fasta_case
def parse_args():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='subparser_name', help='Available commands:')
... | none | 1 | 2.631103 | 3 | |
aoc2020/day_17/part_1.py | en0/aoc2020 | 0 | 6631344 | <gh_stars>0
from aoc2020 import *
from functools import reduce
from .space import Space
class Solution(SolutionABC):
expected = 112
def solve(self) -> any:
space = Space(reduce(lambda a, b: a + b, [
[((x, y, 0), s == '#') for x, s in enumerate(r)]
for y, r in enumerate(self.re... | from aoc2020 import *
from functools import reduce
from .space import Space
class Solution(SolutionABC):
expected = 112
def solve(self) -> any:
space = Space(reduce(lambda a, b: a + b, [
[((x, y, 0), s == '#') for x, s in enumerate(r)]
for y, r in enumerate(self.resource_lines... | none | 1 | 2.977612 | 3 | |
mcw/logging.py | IonAgorria/meson-cmake-wrapper | 63 | 6631345 | import logging
class ServerLogHandler(logging.Handler):
def __init__(self, server):
super().__init__()
self.server = server
def emit(self, record):
log_entry = self.format(record)
if self.server.connected:
self.server.send_message(log_entry, log=False)
| import logging
class ServerLogHandler(logging.Handler):
def __init__(self, server):
super().__init__()
self.server = server
def emit(self, record):
log_entry = self.format(record)
if self.server.connected:
self.server.send_message(log_entry, log=False)
| none | 1 | 2.805761 | 3 | |
alembic/versions/d88d63c07199_.py | andreasots/lrrbot | 24 | 6631346 | revision = 'd88d63c07199'
down_revision = ('<KEY>', '77dc71b483ed')
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
pass
def downgrade():
pass
| revision = 'd88d63c07199'
down_revision = ('<KEY>', '77dc71b483ed')
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
pass
def downgrade():
pass
| none | 1 | 1.014799 | 1 | |
examples/__init__.py | dankilman/pages | 97 | 6631347 | exported_examples = {
'awe_examples': {},
'hello_world': {
'screenshot': [195, 0, 195 + 300, 50],
'extension': 'png'
},
'button_and_input': {
'extension': 'gif'
},
'chart_simple': {
'terminate_after': 35,
'extension': 'gif'
},
'chart_complex': {
... | exported_examples = {
'awe_examples': {},
'hello_world': {
'screenshot': [195, 0, 195 + 300, 50],
'extension': 'png'
},
'button_and_input': {
'extension': 'gif'
},
'chart_simple': {
'terminate_after': 35,
'extension': 'gif'
},
'chart_complex': {
... | none | 1 | 1.531592 | 2 | |
py_kit/check.py | SystemLight/py-kit | 0 | 6631348 | from functools import partial
from typing import Dict, Any, Callable, List, Union
"""
python dict对象校验器
"""
SOME_TYPE = 'some'
EVERY_TYPE = 'every'
class Undefined:
pass
undefined = Undefined()
class BaseMessage:
"""
自定义规则函数返回的对象,可以继承该类,自定义返回Message对象
该类是包含校验信息的消息类,当继承该类后,可以为该类添加方法
用于得到该类时... | from functools import partial
from typing import Dict, Any, Callable, List, Union
"""
python dict对象校验器
"""
SOME_TYPE = 'some'
EVERY_TYPE = 'every'
class Undefined:
pass
undefined = Undefined()
class BaseMessage:
"""
自定义规则函数返回的对象,可以继承该类,自定义返回Message对象
该类是包含校验信息的消息类,当继承该类后,可以为该类添加方法
用于得到该类时... | zh | 0.867143 | python dict对象校验器 自定义规则函数返回的对象,可以继承该类,自定义返回Message对象 该类是包含校验信息的消息类,当继承该类后,可以为该类添加方法 用于得到该类时直接调用处理 :param key: 系统调用,触发message的key值 :param status: 状态 :param msg: 自定义rule函数返回的自定义内容 # 包含子元素从底部传导到顶层的key值 检验dict对象,当一个key值触发错误就返回message对象, 注意检查函数只会检查content中真实存在的内容,不会检查不存在内容, 如果预期值并不能放到content中,请用d... | 2.932594 | 3 |
nindo/client.py | pascalkienast/stats-about-socialmedia | 4 | 6631349 | import asyncio
import urllib.parse
from .http import HTTPClient
from .artist import Artist, RankedArtist, DetailedArtist
from .util import AsyncIterator
from .coupon import Coupon
from .milestone import Milestone
from .viral import Viral
__all__ = (
"NindoClient",
)
class NindoClient:
def __init__(self, **k... | import asyncio
import urllib.parse
from .http import HTTPClient
from .artist import Artist, RankedArtist, DetailedArtist
from .util import AsyncIterator
from .coupon import Coupon
from .milestone import Milestone
from .viral import Viral
__all__ = (
"NindoClient",
)
class NindoClient:
def __init__(self, **k... | en | 0.97723 | # Coupons are the only resource that is paginated | 2.595503 | 3 |
app.py | RTIInternational/ncrp-codes-app | 0 | 6631350 | import os
from functools import partial
from pathlib import Path
from typing import Any, Dict, List
import pandas as pd
import streamlit as st
from more_itertools import ichunked
from stqdm import stqdm
from download import download_link
from model_utils import max_pred_bulk, predict, predict_bulk
PRED_BATCH_SIZE = ... | import os
from functools import partial
from pathlib import Path
from typing import Any, Dict, List
import pandas as pd
import streamlit as st
from more_itertools import ichunked
from stqdm import stqdm
from download import download_link
from model_utils import max_pred_bulk, predict, predict_bulk
PRED_BATCH_SIZE = ... | en | 0.175921 | # ✏️ Single Coder Demo") # 📑 Bulk Coder") # TODO: Add all scores # TODO: Add "confidence" | 2.588876 | 3 |