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 |
|---|---|---|---|---|---|---|---|---|---|---|
toontown/coghq/InGameEditorDCImports.py | TheFamiliarScoot/open-toontown | 99 | 6626351 | if __dev__:
from direct.directutil import DistributedLargeBlobSender
from . import DistributedInGameEditor
| if __dev__:
from direct.directutil import DistributedLargeBlobSender
from . import DistributedInGameEditor
| none | 1 | 1.169687 | 1 | |
livestyled/models/order.py | andrelopez/python-sdk | 0 | 6626352 | from livestyled.models.app import App
from livestyled.models.fulfilment_point import FulfilmentPoint
from livestyled.models.product import Product, ProductVariant
from livestyled.models.user import User
class OrderItem:
def __init__(
self,
id,
fulfilment_point,
quan... | from livestyled.models.app import App
from livestyled.models.fulfilment_point import FulfilmentPoint
from livestyled.models.product import Product, ProductVariant
from livestyled.models.user import User
class OrderItem:
def __init__(
self,
id,
fulfilment_point,
quan... | none | 1 | 2.140191 | 2 | |
transmute_core/frameworks/flask/handler.py | toumorokoshi/web-transmute | 0 | 6626353 | import sys
from functools import wraps
from flask import request, Response
from transmute_core import ParamExtractor, NoArgument
def create_routes_and_handler(transmute_func, context):
@wraps(transmute_func.raw_func)
def handler(*args, **kwargs):
exc, result = None, None
try:
args,... | import sys
from functools import wraps
from flask import request, Response
from transmute_core import ParamExtractor, NoArgument
def create_routes_and_handler(transmute_func, context):
@wraps(transmute_func.raw_func)
def handler(*args, **kwargs):
exc, result = None, None
try:
args,... | en | 0.980867 | flask has it's own route syntax, so we convert it. | 2.479252 | 2 |
clare/clare/common/messaging/consumer/consumers.py | dnguyen0304/room-list-watcher | 0 | 6626354 | <reponame>dnguyen0304/room-list-watcher<gh_stars>0
# -*- coding: utf-8 -*-
import time
from . import exceptions
from . import interfaces
class Consumer(interfaces.IConsumer):
def __init__(self, fetcher, handler, filters=None):
"""
Parameters
----------
fetcher : typing.Type[cla... | # -*- coding: utf-8 -*-
import time
from . import exceptions
from . import interfaces
class Consumer(interfaces.IConsumer):
def __init__(self, fetcher, handler, filters=None):
"""
Parameters
----------
fetcher : typing.Type[clare.common.messaging.consumer.interfaces.IFetcher]
... | en | 0.200304 | # -*- coding: utf-8 -*- Parameters ---------- fetcher : typing.Type[clare.common.messaging.consumer.interfaces.IFetcher] handler : typing.Type[clare.common.messaging.consumer.interfaces.IHandler] filters : typing.Iterable[clare.common.messaging.interfaces.IFilter] Defaults to... | 2.485753 | 2 |
breast_cancer_classifier.py | codedeamon/Breast-Cancer-Classifier | 0 | 6626355 | import numpy as np
import pandas as pd
import scipy as sp
from scipy import stats
import os
from sklearn import preprocessing
from sklearn import svm
from sklearn.metrics import make_scorer
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import KFold
import matplotlib.pyplot as plt
from... | import numpy as np
import pandas as pd
import scipy as sp
from scipy import stats
import os
from sklearn import preprocessing
from sklearn import svm
from sklearn.metrics import make_scorer
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import KFold
import matplotlib.pyplot as plt
from... | en | 0.583292 | Replacing np.bincount in numpy < 1.6 to provide minlength. # labels are now from 0 to len(labels) - 1 -> use bincount # Pathological case # Retain only selected labels ================================================================================================ Normalizing the data ==================================... | 2.661043 | 3 |
client/p_lib/user.py | hazra1991/Message_server_ | 0 | 6626356 | <filename>client/p_lib/user.py
try:
from queue import Queue
except:
from Queue import Queue
import pickle,random
class User:
def __init__(self,username,conn):
self.username = username
self.pending_message = Queue()
self.group_id = username + '@' + str(random.getrandbits(32))
... | <filename>client/p_lib/user.py
try:
from queue import Queue
except:
from Queue import Queue
import pickle,random
class User:
def __init__(self,username,conn):
self.username = username
self.pending_message = Queue()
self.group_id = username + '@' + str(random.getrandbits(32))
... | none | 1 | 2.671201 | 3 | |
Chatbot_Web/web_interface/ner/ie_interface.py | codeants2012/Chatbot_CN | 6 | 6626357 | <filename>Chatbot_Web/web_interface/ner/ie_interface.py
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: ie_interface.py
Description : 信息抽取接口
Author : charl
date: 2018/11/15
-------------------------------------------------
Change Activity: 20... | <filename>Chatbot_Web/web_interface/ner/ie_interface.py
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: ie_interface.py
Description : 信息抽取接口
Author : charl
date: 2018/11/15
-------------------------------------------------
Change Activity: 20... | en | 0.196558 | # -*- coding: utf-8 -*- ------------------------------------------------- File Name: ie_interface.py Description : 信息抽取接口 Author : charl date: 2018/11/15 ------------------------------------------------- Change Activity: 2018/11/15: ------------------------------------------------- | 2.357586 | 2 |
raiden_contracts/constants.py | konradkonrad/raiden-contracts | 0 | 6626358 | <filename>raiden_contracts/constants.py
from enum import Enum, IntEnum
from eth_utils import to_canonical_address
# Contract names
CONTRACT_ENDPOINT_REGISTRY = 'EndpointRegistry'
CONTRACT_HUMAN_STANDARD_TOKEN = 'HumanStandardToken'
CONTRACT_TOKEN_NETWORK_REGISTRY = 'TokenNetworkRegistry'
CONTRACT_TOKEN_NETWORK = 'Tok... | <filename>raiden_contracts/constants.py
from enum import Enum, IntEnum
from eth_utils import to_canonical_address
# Contract names
CONTRACT_ENDPOINT_REGISTRY = 'EndpointRegistry'
CONTRACT_HUMAN_STANDARD_TOKEN = 'HumanStandardToken'
CONTRACT_TOKEN_NETWORK_REGISTRY = 'TokenNetworkRegistry'
CONTRACT_TOKEN_NETWORK = 'Tok... | en | 0.673394 | # Contract names # Deployed contract information # Deployed to Ropsten revival on 2018-09-03 from # raiden-contracts@fc1c79329a165c738fc55c3505cf801cc79872e4 # Deployed to Ropsten revival on 2018-09-21 from # raiden-contracts@bfb24fed3ebda2799e4d11ad1bb5a6de116bd12d # Network configurations # 924 blocks before token ne... | 1.472933 | 1 |
apps/Vision/QRClassification/QRCodeClassificationTester.py | uvic-aero/onboard-computer | 1 | 6626359 | <filename>apps/Vision/QRClassification/QRCodeClassificationTester.py<gh_stars>1-10
from QRCodeClassification import QRCodeClassification
import cv2
import os
"""
simple test file for QRCodeClassification. takes an image as input, converts it to nparray subimages and then returns images as jpgs
"""
tmp = QRCodeClassif... | <filename>apps/Vision/QRClassification/QRCodeClassificationTester.py<gh_stars>1-10
from QRCodeClassification import QRCodeClassification
import cv2
import os
"""
simple test file for QRCodeClassification. takes an image as input, converts it to nparray subimages and then returns images as jpgs
"""
tmp = QRCodeClassif... | en | 0.85168 | simple test file for QRCodeClassification. takes an image as input, converts it to nparray subimages and then returns images as jpgs | 2.921261 | 3 |
recommender/recommender/framework/tf2/layers/dense_to_sparsetensor.py | ericdoug-qi/RecommendationsInAction | 0 | 6626360 | # _*_ coding: utf-8 _*_
"""
-------------------------------------------------
File Name: dense_to_sparsetensor.py
Description :
Author : ericdoug
date:2021/3/20
-------------------------------------------------
Change Activity:
2021/3/20: created
-----------------------------------------------... | # _*_ coding: utf-8 _*_
"""
-------------------------------------------------
File Name: dense_to_sparsetensor.py
Description :
Author : ericdoug
date:2021/3/20
-------------------------------------------------
Change Activity:
2021/3/20: created
-----------------------------------------------... | en | 0.357547 | # _*_ coding: utf-8 _*_ ------------------------------------------------- File Name: dense_to_sparsetensor.py Description : Author : ericdoug date:2021/3/20 ------------------------------------------------- Change Activity: 2021/3/20: created ------------------------------------------------- # ... | 2.239562 | 2 |
rest-service/manager_rest/rest/resources_v1/nodes.py | TS-at-WS/cloudify-manager | 0 | 6626361 | <reponame>TS-at-WS/cloudify-manager
#########
# Copyright (c) 2017 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | #########
# Copyright (c) 2017 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | en | 0.881125 | ######### # Copyright (c) 2017 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless... | 1.86395 | 2 |
codebase/data/utils.py | ShihengDuan/multiple_forcing | 1 | 6626362 | <filename>codebase/data/utils.py
"""
This file is part of the accompanying code to our manuscript:
<NAME>., <NAME>., <NAME>., and <NAME>.: A note on leveraging synergy in multiple meteorological
datasets with deep learning for rainfall-runoff modeling, Hydrol. Earth Syst. Sci. Discuss.,
https://doi.org/10.5194/hess-20... | <filename>codebase/data/utils.py
"""
This file is part of the accompanying code to our manuscript:
<NAME>., <NAME>., <NAME>., and <NAME>.: A note on leveraging synergy in multiple meteorological
datasets with deep learning for rainfall-runoff modeling, Hydrol. Earth Syst. Sci. Discuss.,
https://doi.org/10.5194/hess-20... | en | 0.800654 | This file is part of the accompanying code to our manuscript: <NAME>., <NAME>., <NAME>., and <NAME>.: A note on leveraging synergy in multiple meteorological datasets with deep learning for rainfall-runoff modeling, Hydrol. Earth Syst. Sci. Discuss., https://doi.org/10.5194/hess-2020-221, in review, 2020. You should ... | 2.270267 | 2 |
src/opendr/perception/object_detection_3d/voxel_object_detection_3d/second_detector/protos/input_reader_pb2.py | makistsantekidis/opendr | 217 | 6626363 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: second/protos/input_reader.proto
import sys
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _sy... | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: second/protos/input_reader.proto
import sys
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _sy... | en | 0.375345 | # Generated by the protocol buffer compiler. DO NOT EDIT! # source: second/protos/input_reader.proto # @@protoc_insertion_point(imports) # @@protoc_insertion_point(class_scope:second.protos.InputReader) # @@protoc_insertion_point(module_scope) | 1.191416 | 1 |
gtk_modules/mouse.py | henrikmidtiby/gtk_modules | 0 | 6626364 | from gtk_modules import MouseSignals
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk
class Mouse:
def __init__(self, event_box=None):
if event_box is None:
self.event_box = Gtk.EventBox()
else:
self.event_box = event_box
self.signals = ... | from gtk_modules import MouseSignals
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk
class Mouse:
def __init__(self, event_box=None):
if event_box is None:
self.event_box = Gtk.EventBox()
else:
self.event_box = event_box
self.signals = ... | none | 1 | 2.494024 | 2 | |
pylayers/gis/test/algo_search_convex.py | usmanwardag/pylayers | 143 | 6626365 | #-*- coding:Utf-8 -*-
# from pylayers.gis.layout import *
# from itertools import combinations
# from scipy.spatial import Delaunay
# import shapely.geometry as sh
# L = Layout('WHERE1_2.ini')
# L.build('t')
# # L.dumpr()
# L.showG('s')
# for n in L.Gt.nodes():
# no = L.Gt.node[n]['cycle'].cycle
# nop = L.Gt.... | #-*- coding:Utf-8 -*-
# from pylayers.gis.layout import *
# from itertools import combinations
# from scipy.spatial import Delaunay
# import shapely.geometry as sh
# L = Layout('WHERE1_2.ini')
# L.build('t')
# # L.dumpr()
# L.showG('s')
# for n in L.Gt.nodes():
# no = L.Gt.node[n]['cycle'].cycle
# nop = L.Gt.... | en | 0.413549 | #-*- coding:Utf-8 -*- # from pylayers.gis.layout import * # from itertools import combinations # from scipy.spatial import Delaunay # import shapely.geometry as sh # L = Layout('WHERE1_2.ini') # L.build('t') # # L.dumpr() # L.showG('s') # for n in L.Gt.nodes(): # no = L.Gt.node[n]['cycle'].cycle # nop = L.Gt.no... | 2.157306 | 2 |
test/BribeNet/prediction/test_parameterPrediction.py | RobMurray98/BribeNet | 0 | 6626366 | from unittest import TestCase
from networkit.generators import WattsStrogatzGenerator
from numpy import logspace
from BribeNet.prediction.parameterPrediction import ParameterPrediction
class TestParameterPrediction(TestCase):
def setUp(self) -> None:
self.generator = WattsStrogatzGenerator(50, 6, 0.1)... | from unittest import TestCase
from networkit.generators import WattsStrogatzGenerator
from numpy import logspace
from BribeNet.prediction.parameterPrediction import ParameterPrediction
class TestParameterPrediction(TestCase):
def setUp(self) -> None:
self.generator = WattsStrogatzGenerator(50, 6, 0.1)... | none | 1 | 2.431064 | 2 | |
lvreuse/analysis/combined/construct_launch_vehicle.py | mvernacc/lvreuse | 7 | 6626367 | <gh_stars>1-10
"""Construct a LaunchVehicle given strategy choices and masses."""
import os.path
from lvreuse.cost.elements import CryoLH2TurboFed, ExpendableBallisticStageLH2, \
ExpendableBallisticStageStorable, StorableTurboFed, ReusableBallisticStageLH2, \
VTOStageFlybackVehicle, TurboJetEngine, ReusableBall... | """Construct a LaunchVehicle given strategy choices and masses."""
import os.path
from lvreuse.cost.elements import CryoLH2TurboFed, ExpendableBallisticStageLH2, \
ExpendableBallisticStageStorable, StorableTurboFed, ReusableBallisticStageLH2, \
VTOStageFlybackVehicle, TurboJetEngine, ReusableBallisticStageStora... | en | 0.790514 | Construct a LaunchVehicle given strategy choices and masses. Create a LaunchVehicle object given strategy choices and element masses. Arguments: stage_type: type of first stage vehicle, choose from 'winged' or 'ballistic' prop_choice: propellant choice for first stage, choose from 'kerosene' or 'H2... | 3.001361 | 3 |
asciisciit/asciiart.py | sahwar/asciisciit | 1 | 6626368 | #!/usr/bin/env python
'''
ASCII Toolbox for Converting Images, Movies, Gifs, and Video Feed
Created on 14 Aug 2014
@author: <NAME>
'''
from __future__ import print_function
import time
import os
import platform
from subprocess import Popen, PIPE
import io
import cv2
import numpy as np
from asciisciit.conversion... | #!/usr/bin/env python
'''
ASCII Toolbox for Converting Images, Movies, Gifs, and Video Feed
Created on 14 Aug 2014
@author: <NAME>
'''
from __future__ import print_function
import time
import os
import platform
from subprocess import Popen, PIPE
import io
import cv2
import numpy as np
from asciisciit.conversion... | en | 0.568382 | #!/usr/bin/env python ASCII Toolbox for Converting Images, Movies, Gifs, and Video Feed Created on 14 Aug 2014 @author: <NAME> An image representation of single frame or image file. Parameters ---------- image : str, np.ndarray, PIL.Image Image to convert to text. Can be file path, numpy array, ... | 3.37317 | 3 |
modules/dap/variable.py | daveleroy/sublime_debug | 1 | 6626369 | <reponame>daveleroy/sublime_debug
from __future__ import annotations
from dataclasses import dataclass
import os
from ..typecheck import *
from ..import core
from .import dap
if TYPE_CHECKING:
from .session import Session
@dataclass
class SourceLocation:
source: dap.Source
line: int|None = None
column: int|None... | from __future__ import annotations
from dataclasses import dataclass
import os
from ..typecheck import *
from ..import core
from .import dap
if TYPE_CHECKING:
from .session import Session
@dataclass
class SourceLocation:
source: dap.Source
line: int|None = None
column: int|None = None
@staticmethod
def from_... | none | 1 | 2.40186 | 2 | |
tests/executor.py | Chisanan232/pyocean | 0 | 6626370 | <gh_stars>0
from multirunnable import RunningMode, SimpleExecutor
from multirunnable.parallel.strategy import ProcessStrategy
from multirunnable.concurrent.strategy import ThreadStrategy
from multirunnable.coroutine.strategy import GreenThreadStrategy, AsynchronousStrategy
from .test_config import Worker_Size, Running... | from multirunnable import RunningMode, SimpleExecutor
from multirunnable.parallel.strategy import ProcessStrategy
from multirunnable.concurrent.strategy import ThreadStrategy
from multirunnable.coroutine.strategy import GreenThreadStrategy, AsynchronousStrategy
from .test_config import Worker_Size, Running_Diff_Time, ... | en | 0.809377 | Description: Testing executor which may be as Process, Thread, Green Thread or Asynchronous object. The responsibility of this object is calling the mapping method(s) by the RunningMode. For example, it will use 'multiprocessing.Process.start' when you call 'run' with RunningMode.Parallel. ... | 2.471352 | 2 |
server.py | ar414-com/Image-to-Image-Search | 215 | 6626371 | import glob
import os
from PIL import Image
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulk
from flask import Flask, render_template, request, Response
from werkzeug.utils import secure_filename
import json
from capgen import CaptionGenerator
os.environ['CUDA_VISIBLE_DEVICES'] = ''
es ... | import glob
import os
from PIL import Image
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulk
from flask import Flask, render_template, request, Response
from werkzeug.utils import secure_filename
import json
from capgen import CaptionGenerator
os.environ['CUDA_VISIBLE_DEVICES'] = ''
es ... | en | 0.75158 | # PIL image # PIL image # PIL image # PIL image | 2.180046 | 2 |
__main__.py | g0tmk/internet_connection_monitor | 0 | 6626372 |
from monitoring import main
main()
|
from monitoring import main
main()
| none | 1 | 0.942188 | 1 | |
extensions.py | choyiny/flask-api-starter | 6 | 6626373 | """Extensions module - Set up for additional libraries can go in here."""
import logging
from celery import Celery
import config
# logging
logger = logging.getLogger("flask.general")
# celery
celery = Celery(
"app", broker=config.CELERY_BROKER_URL, backend=config.CELERY_RESULT_BACKEND
)
| """Extensions module - Set up for additional libraries can go in here."""
import logging
from celery import Celery
import config
# logging
logger = logging.getLogger("flask.general")
# celery
celery = Celery(
"app", broker=config.CELERY_BROKER_URL, backend=config.CELERY_RESULT_BACKEND
)
| en | 0.85025 | Extensions module - Set up for additional libraries can go in here. # logging # celery | 1.827999 | 2 |
fstream/protocol/base.py | 33TU/fstream | 0 | 6626374 | <reponame>33TU/fstream
from asyncio import Transport, Future
from asyncio.exceptions import LimitOverrunError
from types import coroutine
from typing import Any, Awaitable, List, Optional, Union
# Awaitable with instant return
_completed = coroutine(lambda: None if True else (yield))()
class BaseStreamProtocol:
... | from asyncio import Transport, Future
from asyncio.exceptions import LimitOverrunError
from types import coroutine
from typing import Any, Awaitable, List, Optional, Union
# Awaitable with instant return
_completed = coroutine(lambda: None if True else (yield))()
class BaseStreamProtocol:
__slots__ = (
... | en | 0.618579 | # Awaitable with instant return Read data from the stream until ``separator`` is found. Read max ``nbytes`` about of bytes. Returns bytearray if ``nbytes`` > 0 otherwise bytes Read exactly ``nbytes`` about of bytes. Returns bytearray if ``nbytes`` > 0 otherwise bytes Reads length prefixed message from t... | 2.446983 | 2 |
rllab/algos/cem.py | prosello/rllab | 10 | 6626375 | <reponame>prosello/rllab<gh_stars>1-10
from rllab.algos.base import RLAlgorithm
import numpy as np
from rllab.misc.special import discount_cumsum
from rllab.sampler import parallel_sampler, stateful_pool
from rllab.sampler.utils import rollout
from rllab.core.serializable import Serializable
import rllab.misc.logger ... | from rllab.algos.base import RLAlgorithm
import numpy as np
from rllab.misc.special import discount_cumsum
from rllab.sampler import parallel_sampler, stateful_pool
from rllab.sampler.utils import rollout
from rllab.core.serializable import Serializable
import rllab.misc.logger as logger
import rllab.plotter as plott... | en | 0.77541 | :param n_itr: Number of iterations. :param max_path_length: Maximum length of a single rollout. :param batch_size: # of samples from trajs from param distribution, when this is set, n_samples is ignored :param discount: Discount. :param plot: Plot evaluation run after each iterat... | 2.148929 | 2 |
charmcraft/linters.py | jguedez/charmcraft | 0 | 6626376 | <reponame>jguedez/charmcraft<filename>charmcraft/linters.py
# Copyright 2021 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | # Copyright 2021 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | en | 0.836932 | # Copyright 2021 Canonical Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s... | 2.126071 | 2 |
tests/src/check/check_assign.py | pystatic/pystatic | 0 | 6626377 | from typing import Union, Literal
class A:
...
# value undefined
a = c # E Cannot determine type of 'c'(unresolved reference 'c')
# any
a = 1
a = "s" # ok
b: int = "hjzs" # E Incompatible type in assignment(expression has type 'Literal['hjzs']', variable has type 'int')
b = a # E Incompatible type in assi... | from typing import Union, Literal
class A:
...
# value undefined
a = c # E Cannot determine type of 'c'(unresolved reference 'c')
# any
a = 1
a = "s" # ok
b: int = "hjzs" # E Incompatible type in assignment(expression has type 'Literal['hjzs']', variable has type 'int')
b = a # E Incompatible type in assi... | en | 0.850538 | # value undefined # E Cannot determine type of 'c'(unresolved reference 'c') # any # ok # E Incompatible type in assignment(expression has type 'Literal['hjzs']', variable has type 'int') # E Incompatible type in assignment(expression has type 'Literal['s']', variable has type 'int') # E Incompatible type in assignment... | 3.786494 | 4 |
mlens/externals/joblib/pool.py | mehrdad-shokri/mlens | 760 | 6626378 | <reponame>mehrdad-shokri/mlens
"""Custom implementation of multiprocessing.Pool with custom pickler.
This module provides efficient ways of working with data stored in
shared memory with numpy.memmap arrays without inducing any memory
copy between the parent and child processes.
This module should not be imported if ... | """Custom implementation of multiprocessing.Pool with custom pickler.
This module provides efficient ways of working with data stored in
shared memory with numpy.memmap arrays without inducing any memory
copy between the parent and child processes.
This module should not be imported if multiprocessing is not
availabl... | en | 0.821382 | Custom implementation of multiprocessing.Pool with custom pickler. This module provides efficient ways of working with data stored in shared memory with numpy.memmap arrays without inducing any memory copy between the parent and child processes. This module should not be imported if multiprocessing is not available a... | 2.749232 | 3 |
src/control/matrix.py | MartinLesser/Procedural-generation-of-3d-trees | 2 | 6626379 | import math
from model.constants import MIN_BRANCH_ROTATION
def mult(vector, float):
"""
Multiplies a vector with a float and returns the result in a new vector.
:param vector: List with elements of the vector.
:param float: float is factor.
:return: vector
"""
new_vector = []
for ite... | import math
from model.constants import MIN_BRANCH_ROTATION
def mult(vector, float):
"""
Multiplies a vector with a float and returns the result in a new vector.
:param vector: List with elements of the vector.
:param float: float is factor.
:return: vector
"""
new_vector = []
for ite... | en | 0.888316 | Multiplies a vector with a float and returns the result in a new vector. :param vector: List with elements of the vector. :param float: float is factor. :return: vector Multiplies two vectors and returns the result as a new vector. :param vector1: List :param vector2: List :return: vector Multip... | 3.826857 | 4 |
scripts/utils.py | max-simon/master-thesis | 4 | 6626380 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: <NAME>
# Year: 2020
import os
import sys
import numpy as np
from scipy.interpolate import NearestNDInterpolator, LinearNDInterpolator, griddata
from scipy.ndimage.filters import uniform_filter1d
import datetime
import netCDF4 as nc
import cftime
def get_area... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: <NAME>
# Year: 2020
import os
import sys
import numpy as np
from scipy.interpolate import NearestNDInterpolator, LinearNDInterpolator, griddata
from scipy.ndimage.filters import uniform_filter1d
import datetime
import netCDF4 as nc
import cftime
def get_area... | en | 0.791488 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: <NAME> # Year: 2020 Calculate the area of grid cells # TODO: use interp.py Convert a string with a Python-like slice notation to a slice object. Parse a string to a datetime object by checking different formats. Also returns the format. Parse a string to an objec... | 2.718734 | 3 |
tools/generate_taint_models/get_globals.py | GreyElaina/pyre-check | 0 | 6626381 | <reponame>GreyElaina/pyre-check
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
import ast
import glob
import logging
import os
from typing import Callable, Iterable, Optiona... | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
import ast
import glob
import logging
import os
from typing import Callable, Iterable, Optional, Set, Tuple, Union
from typin... | en | 0.895691 | # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict # The parent of the property needs to be stored as well, as we only store the # module qualifier. # Ensure that we stop recursing... | 1.727123 | 2 |
igibson/controllers/multi_finger_gripper_controller.py | StanfordVL/InteractiveGibsonEnv | 51 | 6626382 | import numpy as np
from igibson.controllers import ControlType, ManipulationController
from igibson.utils.python_utils import assert_valid_key
VALID_MODES = {
"binary",
"ternary",
}
class MultiFingerGripperController(ManipulationController):
"""
Controller class for **discrete** multi finger gripper... | import numpy as np
from igibson.controllers import ControlType, ManipulationController
from igibson.utils.python_utils import assert_valid_key
VALID_MODES = {
"binary",
"ternary",
}
class MultiFingerGripperController(ManipulationController):
"""
Controller class for **discrete** multi finger gripper... | en | 0.746798 | Controller class for **discrete** multi finger gripper control. This either interprets an input as a binary command (open / close), or ternary (open / stay at current position / close). Ternary mode can only be used as a position controller. **For continuous gripper control, the JointController should be u... | 3.058588 | 3 |
scipy/misc/__init__.py | Ennosigaeon/scipy | 353 | 6626383 | <reponame>Ennosigaeon/scipy<filename>scipy/misc/__init__.py<gh_stars>100-1000
"""
==========================================
Miscellaneous routines (:mod:`scipy.misc`)
==========================================
.. currentmodule:: scipy.misc
Various utilities that don't have another home.
.. autosummary::
:toctree... | """
==========================================
Miscellaneous routines (:mod:`scipy.misc`)
==========================================
.. currentmodule:: scipy.misc
Various utilities that don't have another home.
.. autosummary::
:toctree: generated/
ascent - Get example image for processing
central_diff_wei... | en | 0.729744 | ========================================== Miscellaneous routines (:mod:`scipy.misc`) ========================================== .. currentmodule:: scipy.misc Various utilities that don't have another home. .. autosummary:: :toctree: generated/ ascent - Get example image for processing central_diff_weights... | 2.223475 | 2 |
td3/td3_networks.py | AABL-Lab/Standard_ML_Library | 0 | 6626384 | """
This code mainly follows a td3 YouTube tutorial found at:
https://www.youtube.com/watch?v=ZhFO8EWADmY&t=1895s
Channel name: Machine Learning with Phil
Any modifiations are made by the AABL Lab.
"""
import numpy as np
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.function... | """
This code mainly follows a td3 YouTube tutorial found at:
https://www.youtube.com/watch?v=ZhFO8EWADmY&t=1895s
Channel name: Machine Learning with Phil
Any modifiations are made by the AABL Lab.
"""
import numpy as np
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.function... | en | 0.857323 | This code mainly follows a td3 YouTube tutorial found at: https://www.youtube.com/watch?v=ZhFO8EWADmY&t=1895s Channel name: Machine Learning with Phil Any modifiations are made by the AABL Lab. # the * is for tuple unpacking | 2.664901 | 3 |
venv/Lib/site-packages/wsproto/connection.py | gilbertekalea/booking.com_crawler | 179 | 6626385 | <reponame>gilbertekalea/booking.com_crawler
"""
wsproto/connection
~~~~~~~~~~~~~~~~~~
An implementation of a WebSocket connection.
"""
from collections import deque
from enum import Enum
from typing import Deque, Generator, List, Optional
from .events import (
BytesMessage,
CloseConnection,
Event,
Me... | """
wsproto/connection
~~~~~~~~~~~~~~~~~~
An implementation of a WebSocket connection.
"""
from collections import deque
from enum import Enum
from typing import Deque, Generator, List, Optional
from .events import (
BytesMessage,
CloseConnection,
Event,
Message,
Ping,
Pong,
TextMessage,
... | en | 0.896737 | wsproto/connection ~~~~~~~~~~~~~~~~~~ An implementation of a WebSocket connection. RFC 6455, Section 4 - Opening Handshake #: The opening handshake is in progress. #: The opening handshake is complete. #: The remote WebSocket has initiated a connection close. #: The local WebSocket (i.e. this instance) has initiated a... | 2.938201 | 3 |
client/commands/v2/tests/statistics_test.py | ekmixon/pyre-check | 5,975 | 6626386 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import tempfile
import textwrap
from pathlib import Path
import testslide
from .... import configuration, command_arguments
from ....tests i... | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import tempfile
import textwrap
from pathlib import Path
import testslide
from .... import configuration, command_arguments
from ....tests i... | en | 0.875524 | # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. def foo() -> int: pass def foo() -> # pyre-unsafe def foo(): return 1 # py... | 2.27162 | 2 |
zerver/tests/test_middleware.py | alexandraciobica/zulip | 4 | 6626387 | import time
from typing import List
from bs4 import BeautifulSoup
from django.test import override_settings
from unittest.mock import Mock, patch
from zerver.lib.realm_icon import get_realm_icon_url
from zerver.lib.test_classes import ZulipTestCase
from zerver.middleware import is_slow_query, write_log_line
from zerve... | import time
from typing import List
from bs4 import BeautifulSoup
from django.test import override_settings
from unittest.mock import Mock, patch
from zerver.lib.realm_icon import get_realm_icon_url
from zerver.lib.test_classes import ZulipTestCase
from zerver.middleware import is_slow_query, write_log_line
from zerve... | en | 0.861931 | # disable-message-edit-history starts with an {!admin-only.md!}, and has a link # in the first paragraph. # night-mode has a quoted string "night mode" # deactivate-your-account starts with {settings_tab|your-account} # logging-out starts with {start_tabs} # Ideally we'd do something better here # Probably we should ma... | 2.039517 | 2 |
2-1.TextCNN/train_eval.py | techthiyanes/nlp-notebook | 136 | 6626388 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import optuna
from sklearn import metrics
from optuna.trial import TrialState
from model import TextCNN
from load_data import train_iter, val_iter, id2vocab
EPOCHS = 10
CLS = 2
device = "cuda" i... | # -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import optuna
from sklearn import metrics
from optuna.trial import TrialState
from model import TextCNN
from load_data import train_iter, val_iter, id2vocab
EPOCHS = 10
CLS = 2
device = "cuda" if torch.cuda.is_ava... | en | 0.35356 | # -*- coding: utf-8 -*- #print(f'Epoch[{epoch}] - Loss:{sum(epoch_loss)/len(epoch_loss)}') | 2.527859 | 3 |
MAF.py | Fan-Han/Population-analysis-with-pooled-data | 1 | 6626389 | #! /usr/bin/python3
# Calculate the allele frequency for particular populations
import sys
import argparse
parser = argparse.ArgumentParser(description = "Calculate the minor allele frequency for particular group of samples")
parser.add_argument("--pop", type = str, help = "Population list that the MAF will calculate... | #! /usr/bin/python3
# Calculate the allele frequency for particular populations
import sys
import argparse
parser = argparse.ArgumentParser(description = "Calculate the minor allele frequency for particular group of samples")
parser.add_argument("--pop", type = str, help = "Population list that the MAF will calculate... | en | 0.717474 | #! /usr/bin/python3 # Calculate the allele frequency for particular populations # read all samples into a list # header # Go through AD file # check if all samples are in the AD file #print(len(sample_index)) # read allelic depth # MAF | 3.15875 | 3 |
models/m2_transformer/encoders.py | lmfethan/RSTNet | 0 | 6626390 | <gh_stars>0
from torch.nn import functional as F
from models.m2_transformer.utils import PositionWiseFeedForward
import torch
from torch import nn
from models.m2_transformer.attention import MultiHeadAttention
class EncoderLayer(nn.Module):
def __init__(self, d_model=512, d_k=64, d_v=64, h=8, d_ff=2048, d... | from torch.nn import functional as F
from models.m2_transformer.utils import PositionWiseFeedForward
import torch
from torch import nn
from models.m2_transformer.attention import MultiHeadAttention
class EncoderLayer(nn.Module):
def __init__(self, d_model=512, d_k=64, d_v=64, h=8, d_ff=2048, dropout=.1, i... | en | 0.163706 | # input (b_s, seq_len, d_in) # (b_s, 1, 1, seq_len) | 2.356951 | 2 |
tourboxneo/menu.py | AlexandraAlter/tourboxneo | 0 | 6626391 | import logging
import toml
import time
import tkinter as tk
from tkinter import ttk
from threading import *
logger = logging.getLogger(__name__)
FONT = ('Verdana', 12)
NORM_FONT = ('Helvetica', 10)
SMALL_FONT = ('Helvetica', 8)
gui_thread = None
def start_tk(tk):
tk.mainloop()
class Menu(tk.Tk):
def __in... | import logging
import toml
import time
import tkinter as tk
from tkinter import ttk
from threading import *
logger = logging.getLogger(__name__)
FONT = ('Verdana', 12)
NORM_FONT = ('Helvetica', 10)
SMALL_FONT = ('Helvetica', 8)
gui_thread = None
def start_tk(tk):
tk.mainloop()
class Menu(tk.Tk):
def __in... | en | 0.585941 | # basic setup # callbacks # position | 2.761093 | 3 |
misago/project_template/project_name/settings.py | HenryChenV/iJiangNan | 1 | 6626392 | <gh_stars>1-10
"""
Django settings for {{ project_name }} project.
Generated by 'django-admin startproject' using Django {{ django_version }}.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
https://docs.... | """
Django settings for {{ project_name }} project.
Generated by 'django-admin startproject' using Django {{ django_version }}.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.c... | en | 0.653894 | Django settings for {{ project_name }} project. Generated by 'django-admin startproject' using Django {{ django_version }}. For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/e... | 2.067695 | 2 |
HR_Easy/hr_flipping_bits.py | rndmz451/tinuviel-project | 0 | 6626393 | <gh_stars>0
'''
You will be given a list of 32 bit unsigned integers. Flip all the bits (1 -> 0 and 0 -> 1) and return the result as an unsigned integer.
'''
n = 2
def flipping_bits(n):
num = (2 ** 32) - 1
return n ^ num
if __name__ == '__main__':
print(flipping_bits(n)) | '''
You will be given a list of 32 bit unsigned integers. Flip all the bits (1 -> 0 and 0 -> 1) and return the result as an unsigned integer.
'''
n = 2
def flipping_bits(n):
num = (2 ** 32) - 1
return n ^ num
if __name__ == '__main__':
print(flipping_bits(n)) | en | 0.877958 | You will be given a list of 32 bit unsigned integers. Flip all the bits (1 -> 0 and 0 -> 1) and return the result as an unsigned integer. | 4.094314 | 4 |
keras_extension/preprocess/graph.py | k1414st/keras_extention | 3 | 6626394 | # -*- coding: utf-8 -*-
"""
Transformation function from "graph adjacency matrix" to
1. graph laplacian matrix
2. normalize graph matrix
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from scipy.sparse.csr import csr_matrix
... | # -*- coding: utf-8 -*-
"""
Transformation function from "graph adjacency matrix" to
1. graph laplacian matrix
2. normalize graph matrix
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from scipy.sparse.csr import csr_matrix
... | en | 0.488529 | # -*- coding: utf-8 -*- Transformation function from "graph adjacency matrix" to 1. graph laplacian matrix 2. normalize graph matrix # to avoid zero division execute dot operation for each unit get identity matrix or batched matrices of X get diagonal matrix or batched matrices of X calculate laplacian matrix. ... | 3.186982 | 3 |
lib/streamlit/string_util.py | rajvijay68/streamlit | 1 | 6626395 | # -*- coding: utf-8 -*-
# Copyright 2018-2020 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | # -*- coding: utf-8 -*-
# Copyright 2018-2020 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | en | 0.767677 | # -*- coding: utf-8 -*- # Copyright 2018-2020 Streamlit Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl... | 2.650272 | 3 |
run_comparison_heapsearch_astar.py | agissaud/DeepSynth | 0 | 6626396 | import logging
import time
import random
import csv
import matplotlib.pyplot as plt
import numpy as np
from math import log10
from type_system import Type, PolymorphicType, PrimitiveType, Arrow, List, UnknownType, INT, BOOL
from program import Program, Function, Variable, BasicPrimitive, New
from cfg import CFG
from p... | import logging
import time
import random
import csv
import matplotlib.pyplot as plt
import numpy as np
from math import log10
from type_system import Type, PolymorphicType, PrimitiveType, Arrow, List, UnknownType, INT, BOOL
from program import Program, Function, Variable, BasicPrimitive, New
from cfg import CFG
from p... | en | 0.725091 | # from Algorithms.heap_search_naive import heap_search_naive # (heap_search_naive, 'Heap Search naive', {}), Run the algorithm until timeout, and for each program record probability and time of output # no next program # logging.debug('program found: {}'.format(program)) # Plot comparison | 2.56705 | 3 |
Task_1/Task_1A/Code/nnet/__init__.py | NithishB/eyantra2k18 | 0 | 6626397 | from nnet import activation, loss, model, optimizer | from nnet import activation, loss, model, optimizer | none | 1 | 1.010425 | 1 | |
multischema/multischema/routers.py | jelitox/django_async | 0 | 6626398 | """Class definition for Database Routing."""
from django.urls import resolve
from django.apps import apps
from django.conf import settings
from django.db import router, connections
import sys
import threading
from django.http import Http404
request_cfg = threading.local()
DEFAULT_DB_ALIAS = 'default'
USER_APPS = se... | """Class definition for Database Routing."""
from django.urls import resolve
from django.apps import apps
from django.conf import settings
from django.db import router, connections
import sys
import threading
from django.http import Http404
request_cfg = threading.local()
DEFAULT_DB_ALIAS = 'default'
USER_APPS = se... | en | 0.753891 | Class definition for Database Routing. A router to control troc db operations. Get information about databases. #print(model._meta.db_table) Point all operations on app1 models to 'db_app1'. Point all operations on app1 models to 'db_app1'. #db_table = 'schema\".\"tablename' # Read Only Database #print(table.find('.'))... | 2.616301 | 3 |
RecoTracker/TkSeedGenerator/python/GlobalCombinedSeeds_cff.py | ckamtsikis/cmssw | 852 | 6626399 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
from RecoTracker.TkSeedGenerator.GlobalCombinedSeeds_cfi import *
| import FWCore.ParameterSet.Config as cms
from RecoTracker.TkSeedGenerator.GlobalCombinedSeeds_cfi import * | none | 1 | 1.071465 | 1 | |
acme/acme/standalone_test.py | jcollie/certbot | 4 | 6626400 | <reponame>jcollie/certbot
"""Tests for acme.standalone."""
import multiprocessing
import os
import shutil
import socket
import threading
import tempfile
import unittest
import time
from contextlib import closing
from six.moves import http_client # pylint: disable=import-error
from six.moves import socketserver # typ... | """Tests for acme.standalone."""
import multiprocessing
import os
import shutil
import socket
import threading
import tempfile
import unittest
import time
from contextlib import closing
from six.moves import http_client # pylint: disable=import-error
from six.moves import socketserver # type: ignore # pylint: disab... | en | 0.670555 | Tests for acme.standalone. # pylint: disable=import-error # type: ignore # pylint: disable=import-error # pylint: disable=unused-import, no-name-in-module Tests for acme.standalone.TLSServer. # pylint: disable=no-self-use Test for acme.standalone.TLSSNI01Server. Tests for acme.standalone.HTTP01Server. # type: Set Test... | 2.098183 | 2 |
k-nearest-neighbors/k_nearest_neighbor_knn_tutorial.py | fimoziq/tutorials | 670 | 6626401 | # -*- coding: utf-8 -*-
"""
#K-Nearest Neighbors (KNN) Algorithm Tutorial - Machine Learning Basics
* Tutorial: https://news.towardsai.net/knn
* Github: https://github.com/towardsai/tutorials/tree/master/k-nearest-neighbors
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sn... | # -*- coding: utf-8 -*-
"""
#K-Nearest Neighbors (KNN) Algorithm Tutorial - Machine Learning Basics
* Tutorial: https://news.towardsai.net/knn
* Github: https://github.com/towardsai/tutorials/tree/master/k-nearest-neighbors
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sn... | en | 0.813926 | # -*- coding: utf-8 -*- #K-Nearest Neighbors (KNN) Algorithm Tutorial - Machine Learning Basics * Tutorial: https://news.towardsai.net/knn * Github: https://github.com/towardsai/tutorials/tree/master/k-nearest-neighbors # Import the iris dataset as provided by the sklearn Python module # Converting sklearn data into Pa... | 3.885892 | 4 |
python/GafferUI/MultiLineStringPlugValueWidget.py | ddesmond/gaffer | 561 | 6626402 | ##########################################################################
#
# Copyright (c) 2012, <NAME>. All rights reserved.
# Copyright (c) 2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the f... | ##########################################################################
#
# Copyright (c) 2012, <NAME>. All rights reserved.
# Copyright (c) 2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the f... | en | 0.622536 | ########################################################################## # # Copyright (c) 2012, <NAME>. All rights reserved. # Copyright (c) 2012, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the f... | 0.798653 | 1 |
oop/relationships.py | ramkumarkrishnan/LearnPython | 0 | 6626403 | # Object Relationships
print ("\nAggregation - Has-A relationship")
print ("Example - Country has many persons")
class Country:
def __init__(self, name=None, population=0):
self.name = name
self.population = population
def printDetails(self):
print("Country Name:", self.name)
... | # Object Relationships
print ("\nAggregation - Has-A relationship")
print ("Example - Country has many persons")
class Country:
def __init__(self, name=None, population=0):
self.name = name
self.population = population
def printDetails(self):
print("Country Name:", self.name)
... | en | 0.551848 | # Object Relationships | 4.204139 | 4 |
test/test_scp.py | IMRCLab/kinodynamic-motion-planning-benchmark | 0 | 6626404 | import sys
import os
import pytest
sys.path.append(os.getcwd() + "/../scripts")
from main_scp import run_scp
import checker
# skip all tests in this module
pytestmark = pytest.mark.skip(reason="SCP currently not supported")
def _run_check(filename_env: str, filename_guess: str, filename_result: str):
result = ru... | import sys
import os
import pytest
sys.path.append(os.getcwd() + "/../scripts")
from main_scp import run_scp
import checker
# skip all tests in this module
pytestmark = pytest.mark.skip(reason="SCP currently not supported")
def _run_check(filename_env: str, filename_guess: str, filename_result: str):
result = ru... | en | 0.553496 | # skip all tests in this module | 2.367017 | 2 |
test/functional/wallet_signer.py | qogecoin/qogecoin | 9 | 6626405 | #!/usr/bin/env python3
# Copyright (c) 2017-2021 The Bitcoin and Qogecoin Core Authors
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test external signer.
Verify that a qogecoind node can use an external signer command
See al... | #!/usr/bin/env python3
# Copyright (c) 2017-2021 The Bitcoin and Qogecoin Core Authors
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test external signer.
Verify that a qogecoind node can use an external signer command
See al... | en | 0.460329 | #!/usr/bin/env python3 # Copyright (c) 2017-2021 The Bitcoin and Qogecoin Core Authors # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. Test external signer. Verify that a qogecoind node can use an external signer command See also ... | 2.153908 | 2 |
settings.py | cajohnst/Optimized_FX_Portfolio | 11 | 6626406 | <reponame>cajohnst/Optimized_FX_Portfolio
#Set variables
import datetime
from datetime import date, timedelta
# authorization key for quandl data
auth_tok = "<KEY>"
# Input last day to get returns data for (default is today)
end_date = datetime.date.today() - timedelta(3)
# Input original portfolio value, used for VaR... | #Set variables
import datetime
from datetime import date, timedelta
# authorization key for quandl data
auth_tok = "<KEY>"
# Input last day to get returns data for (default is today)
end_date = datetime.date.today() - timedelta(3)
# Input original portfolio value, used for VaR calculations
portfolio_value = 1000
# Inp... | en | 0.87396 | #Set variables # authorization key for quandl data # Input last day to get returns data for (default is today) # Input original portfolio value, used for VaR calculations # Input number of days to calculate back returns #Compute returns with shift percentage change delay (daily = 1) # Input Leverage # Input Rolling Per... | 2.494443 | 2 |
final_pipeline/main.py | pjrule/covid-path-planning | 5 | 6626407 | # Main script to solve the UV Light optimization problem
import pandas as pd
from room import Room
from polygon_extraction import extract_polygon, construct_isValidLocation_function
from lp_solver import solve_full_lp, visualize_times, solve_naive, visualize_energy, visualize_distance
from shapely.geometry import box
... | # Main script to solve the UV Light optimization problem
import pandas as pd
from room import Room
from polygon_extraction import extract_polygon, construct_isValidLocation_function
from lp_solver import solve_full_lp, visualize_times, solve_naive, visualize_energy, visualize_distance
from shapely.geometry import box
... | en | 0.723006 | # Main script to solve the UV Light optimization problem ###################### ### Parameters ### ###################### # I/O Files #INPUT_FILE = '../floor_plans/hrilab_2510_sled.pgm' #INPUT_YAML = '../floor_plans/hrilab_2510_sled.yaml' # Environment parameters # Height of UV light, in meters # Distance from robo... | 2.572122 | 3 |
neighborhood_data/add_non_ecc.py | trinity-gao/echo-locator | 2 | 6626408 | <reponame>trinity-gao/echo-locator
#!/usr/bin/env python
# encoding=utf8
"""
Produces a GeoJSON file of the ECC neighborhood points with associated data.
Expects `add_zcta_centroids.py` was already run to identify the points.
"""
import csv
import errno
import os
ECC_NEIGHBORHOOD_CSV = 'ecc_neighborhoods.csv'
NON_E... | #!/usr/bin/env python
# encoding=utf8
"""
Produces a GeoJSON file of the ECC neighborhood points with associated data.
Expects `add_zcta_centroids.py` was already run to identify the points.
"""
import csv
import errno
import os
ECC_NEIGHBORHOOD_CSV = 'ecc_neighborhoods.csv'
NON_ECC_NEIGHBORHOOD_CSV = 'non_ecc_max_... | en | 0.866958 | #!/usr/bin/env python # encoding=utf8 Produces a GeoJSON file of the ECC neighborhood points with associated data. Expects `add_zcta_centroids.py` was already run to identify the points. # Read CSVs of neighborhoods, keyed by zip code. # Add the fields from the ECC CSV to the combination ECC and non-ECC | 2.771548 | 3 |
137-single-number-ii/137-single-number-ii.py | hyeseonko/LeetCode | 2 | 6626409 | <gh_stars>1-10
class Solution:
def singleNumber(self, nums: List[int]) -> int:
for num in set(nums):
if nums.count(num)==1:
return num | class Solution:
def singleNumber(self, nums: List[int]) -> int:
for num in set(nums):
if nums.count(num)==1:
return num | none | 1 | 3.191027 | 3 | |
games/hash/migrations/0007_auto_20200217_2044.py | Sharmaxz/battle-dual-api | 0 | 6626410 | # Generated by Django 3.0.3 on 2020-02-17 20:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('hash', '0006_hash_matrix'),
]
operations = [
migrations.RemoveField(
model_name='hash',
name='cols',
),
migr... | # Generated by Django 3.0.3 on 2020-02-17 20:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('hash', '0006_hash_matrix'),
]
operations = [
migrations.RemoveField(
model_name='hash',
name='cols',
),
migr... | en | 0.786301 | # Generated by Django 3.0.3 on 2020-02-17 20:44 | 1.68821 | 2 |
fontbuilder/ttf2eot/__init__.py | plrthink/myicons | 83 | 6626411 | #!/usr/bin/env python
# encoding: utf-8
"""
Translate ttf files to IE8 compatible EOT files.
Based on the implementation of ttf2eot in nodejs by fontello.
(https://github.com/fontello/ttf2eot/)
"""
import consts
from .bytebuffer import ByteBuffer
__all__ = ('ttf2eot', )
def strbuf(raw):
b = ByteBuffer(bytearr... | #!/usr/bin/env python
# encoding: utf-8
"""
Translate ttf files to IE8 compatible EOT files.
Based on the implementation of ttf2eot in nodejs by fontello.
(https://github.com/fontello/ttf2eot/)
"""
import consts
from .bytebuffer import ByteBuffer
__all__ = ('ttf2eot', )
def strbuf(raw):
b = ByteBuffer(bytearr... | en | 0.545956 | #!/usr/bin/env python # encoding: utf-8 Translate ttf files to IE8 compatible EOT files. Based on the implementation of ttf2eot in nodejs by fontello. (https://github.com/fontello/ttf2eot/) | 2.229227 | 2 |
epregressions/tests/resources/dummy.parametric.py | lefticus/EnergyPlusRegressionTool | 0 | 6626412 | <filename>epregressions/tests/resources/dummy.parametric.py
#!/usr/bin/env python
import shutil
file_contents = open('in.idf').read().upper()
if 'PARAMETRIC:' in file_contents:
shutil.copy('in.idf', 'in-01.idf')
shutil.copy('in.idf', 'in-02.idf')
shutil.copy('in.idf', 'in-03.idf')
| <filename>epregressions/tests/resources/dummy.parametric.py
#!/usr/bin/env python
import shutil
file_contents = open('in.idf').read().upper()
if 'PARAMETRIC:' in file_contents:
shutil.copy('in.idf', 'in-01.idf')
shutil.copy('in.idf', 'in-02.idf')
shutil.copy('in.idf', 'in-03.idf')
| ru | 0.26433 | #!/usr/bin/env python | 1.803102 | 2 |
data/dataProcess.py | ISSCentaurus/MGE | 2 | 6626413 | <filename>data/dataProcess.py<gh_stars>1-10
import argparse
class FindGrowth():
def __init__(self):
self.currentVialSet = 0 # Increment when unplugged (Sample Swapped)
self.currentDataSet = 0 # Increment when begin logging (Every Minute)
self.currentTemp = 0 # Increment when begin logging
... | <filename>data/dataProcess.py<gh_stars>1-10
import argparse
class FindGrowth():
def __init__(self):
self.currentVialSet = 0 # Increment when unplugged (Sample Swapped)
self.currentDataSet = 0 # Increment when begin logging (Every Minute)
self.currentTemp = 0 # Increment when begin logging
... | en | 0.453568 | # Increment when unplugged (Sample Swapped) # Increment when begin logging (Every Minute) # Increment when begin logging # Increment when new vial (Every ~80ms) # Increment when new vial # Increment when new vial #Vial specifc # CHANGE TO True TO LOG minLight FOR ALL VIALS # Sample Swapped | 2.545363 | 3 |
zappa/wsgi.py | SongYunSeop/Zappa | 1 | 6626414 | import logging
import base64
from urllib import urlencode
from requestlogger import ApacheFormatter
from StringIO import StringIO
def create_wsgi_request(event_info, server_name='zappa', script_name=None,
trailing_slash=True):
"""
Given some event_info,
create and retu... | import logging
import base64
from urllib import urlencode
from requestlogger import ApacheFormatter
from StringIO import StringIO
def create_wsgi_request(event_info, server_name='zappa', script_name=None,
trailing_slash=True):
"""
Given some event_info,
create and retu... | en | 0.699895 | Given some event_info, create and return a valid WSGI request environ. # Extract remote user from context if Authorizer is enabled # Non-GET data is B64'd through the APIGW. # if method in ["POST", "PUT", "PATCH"]: # encoded_body = event_info['body'] # body = base64.b64decode(encoded_body) # else: # Wil... | 2.529758 | 3 |
vsts/vsts/release/v4_0/models/manual_intervention.py | kenkuo/azure-devops-python-api | 0 | 6626415 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | en | 0.49135 | # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------... | 1.584211 | 2 |
bitmovin_api_sdk/encoding/inputs/s3_role_based/customdata/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 11 | 6626416 | from bitmovin_api_sdk.encoding.inputs.s3_role_based.customdata.customdata_api import CustomdataApi
| from bitmovin_api_sdk.encoding.inputs.s3_role_based.customdata.customdata_api import CustomdataApi
| none | 1 | 1.134507 | 1 | |
rl_sandbox/algorithms/sac/sac_drq.py | chanb/rl_sandbox_public | 14 | 6626417 | <filename>rl_sandbox/algorithms/sac/sac_drq.py
import timeit
import torch
import torch.nn as nn
import rl_sandbox.constants as c
from rl_sandbox.algorithms.sac.sac import SAC
from rl_sandbox.algorithms.utils import aug_data
from rl_sandbox.auxiliary_tasks.auxiliary_tasks import AuxiliaryTask
class SACDrQ(SAC):
... | <filename>rl_sandbox/algorithms/sac/sac_drq.py
import timeit
import torch
import torch.nn as nn
import rl_sandbox.constants as c
from rl_sandbox.algorithms.sac.sac import SAC
from rl_sandbox.algorithms.utils import aug_data
from rl_sandbox.auxiliary_tasks.auxiliary_tasks import AuxiliaryTask
class SACDrQ(SAC):
... | en | 0.898768 | # Number of target Q augmentations # Number of Q augmentations # Perform SAC update # Auxiliary tasks are usually for shared layers, which is updated along with Q # Update Q functions # Update policy # Update Alpha | 1.978395 | 2 |
scripts/auth.py | maxkraus1/brightspace_admin_app | 0 | 6626418 | import json
import os
import requests
dir = os.path.dirname(__file__)
creds_json = os.path.join(dir, "records/credentials.json")
with open(creds_json) as infile:
creds = json.load(infile) # get current credentials
payload = {
"grant_type": "refresh_token",
"refresh_token": creds["refres... | import json
import os
import requests
dir = os.path.dirname(__file__)
creds_json = os.path.join(dir, "records/credentials.json")
with open(creds_json) as infile:
creds = json.load(infile) # get current credentials
payload = {
"grant_type": "refresh_token",
"refresh_token": creds["refres... | en | 0.912905 | # get current credentials # check if response was successful # update stored credentials with new access and refresh tokens # save new credentials to records/credentials.json | 2.793135 | 3 |
DailyProgrammer/DP20141008B.py | DayGitH/Python-Challenges | 2 | 6626419 | <reponame>DayGitH/Python-Challenges
"""
[10/08/2014] Challenge #183 [Intermediate] Edge Matching Tile Puzzle
https://www.reddit.com/r/dailyprogrammer/comments/2ip1gj/10082014_challenge_183_intermediate_edge_matching/
#Credit:
Thanks to /u/skeeto for this challenge. As posted on our /r/dailyprogrammer_ideas subreddit.... | """
[10/08/2014] Challenge #183 [Intermediate] Edge Matching Tile Puzzle
https://www.reddit.com/r/dailyprogrammer/comments/2ip1gj/10082014_challenge_183_intermediate_edge_matching/
#Credit:
Thanks to /u/skeeto for this challenge. As posted on our /r/dailyprogrammer_ideas subreddit.
#Description:
There's a tile puzzle... | en | 0.796323 | [10/08/2014] Challenge #183 [Intermediate] Edge Matching Tile Puzzle https://www.reddit.com/r/dailyprogrammer/comments/2ip1gj/10082014_challenge_183_intermediate_edge_matching/ #Credit: Thanks to /u/skeeto for this challenge. As posted on our /r/dailyprogrammer_ideas subreddit. #Description: There's a tile puzzle gam... | 3.623425 | 4 |
tango.py | cg2v/Tango | 41 | 6626420 | #
# Tango is a job management service that manages requests for jobs to
# be run in virtual machines. Tango consists of five main components:
#
# 1. The Restful API: This is the interface for Tango that receives
# requests from clients via HTTP. AddJob requests are converted
# into a form that the tangoServer und... | #
# Tango is a job management service that manages requests for jobs to
# be run in virtual machines. Tango consists of five main components:
#
# 1. The Restful API: This is the interface for Tango that receives
# requests from clients via HTTP. AddJob requests are converted
# into a form that the tangoServer und... | en | 0.842681 | # # Tango is a job management service that manages requests for jobs to # be run in virtual machines. Tango consists of five main components: # # 1. The Restful API: This is the interface for Tango that receives # requests from clients via HTTP. AddJob requests are converted # into a form that the tangoServer und... | 2.969218 | 3 |
tests/test_diffuser.py | tkonopka/crossmap | 1 | 6626421 | """
Tests for obtaining feature co-occurance and diffusing vectors
"""
import unittest
from os.path import join
from crossmap.settings import CrossmapSettings
from crossmap.indexer import CrossmapIndexer
from crossmap.diffuser import CrossmapDiffuser
from crossmap.tokenizer import CrossmapTokenizer, CrossmapDiffusionT... | """
Tests for obtaining feature co-occurance and diffusing vectors
"""
import unittest
from os.path import join
from crossmap.settings import CrossmapSettings
from crossmap.indexer import CrossmapIndexer
from crossmap.diffuser import CrossmapDiffuser
from crossmap.tokenizer import CrossmapTokenizer, CrossmapDiffusionT... | en | 0.911517 | Tests for obtaining feature co-occurance and diffusing vectors Managing co-occurrence counts count tables should have one row per feature # there are two datasets (targets, documents), each with n rows extract counts from db for one feature # db fetch should provide counts for one feature # count vector should match fe... | 2.266695 | 2 |
cupyimg/skimage/restoration/_denoise.py | haesleinhuepf/cupyimg | 39 | 6626422 | <reponame>haesleinhuepf/cupyimg
import cupy as cp
from .. import img_as_float
def _denoise_tv_chambolle_nd(image, weight=0.1, eps=2.0e-4, n_iter_max=200):
"""Perform total-variation denoising on n-dimensional images.
Parameters
----------
image : ndarray
n-D input data to be denoised.
we... | import cupy as cp
from .. import img_as_float
def _denoise_tv_chambolle_nd(image, weight=0.1, eps=2.0e-4, n_iter_max=200):
"""Perform total-variation denoising on n-dimensional images.
Parameters
----------
image : ndarray
n-D input data to be denoised.
weight : float, optional
D... | en | 0.712176 | Perform total-variation denoising on n-dimensional images. Parameters ---------- image : ndarray n-D input data to be denoised. weight : float, optional Denoising weight. The greater `weight`, the more denoising (at the expense of fidelity to `input`). eps : float, optional ... | 2.880289 | 3 |
tests/test_flask_reuploaded.py | pkesavap/flask-reuploaded | 0 | 6626423 | """
:copyright: 2010 Matthew "LeafStorm" Frazier
:license: MIT/X11, see LICENSE for details
"""
import os
import os.path
import pytest
from flask import Flask
from flask import url_for
from flask_uploads import ALL
from flask_uploads import AllExcept
from flask_uploads import TestingFileStorage
from flask_uploads i... | """
:copyright: 2010 Matthew "LeafStorm" Frazier
:license: MIT/X11, see LICENSE for details
"""
import os
import os.path
import pytest
from flask import Flask
from flask import url_for
from flask_uploads import ALL
from flask_uploads import AllExcept
from flask_uploads import TestingFileStorage
from flask_uploads i... | en | 0.752375 | :copyright: 2010 Matthew "LeafStorm" Frazier :license: MIT/X11, see LICENSE for details UploadSet.save needs a valid FileStorage object. When something different is passed in, a TypeError gets raised. | 2.113042 | 2 |
tests/algorithms/gd/test_quickprop.py | vishalbelsare/neupy | 0 | 6626424 | <gh_stars>0
from functools import partial
from sklearn import datasets, model_selection, preprocessing
from neupy import algorithms
from utils import compare_networks
from base import BaseTestCase
class QuickPropTestCase(BaseTestCase):
def setUp(self):
super(QuickPropTestCase, self).setUp()
dat... | from functools import partial
from sklearn import datasets, model_selection, preprocessing
from neupy import algorithms
from utils import compare_networks
from base import BaseTestCase
class QuickPropTestCase(BaseTestCase):
def setUp(self):
super(QuickPropTestCase, self).setUp()
data, target = ... | en | 0.437756 | # Test classes # Test data # Network configurations # Test configurations | 2.413468 | 2 |
modules/config.py | eidanyosoy/Plex-Meta-Manager | 0 | 6626425 | <filename>modules/config.py<gh_stars>0
import base64, logging, os, requests
from datetime import datetime
from lxml import html
from modules import util, radarr, sonarr
from modules.anidb import AniDB
from modules.anilist import AniList
from modules.cache import Cache
from modules.convert import Convert
from modules.fl... | <filename>modules/config.py<gh_stars>0
import base64, logging, os, requests
from datetime import datetime
from lxml import html
from modules import util, radarr, sonarr
from modules.anidb import AniDB
from modules.anilist import AniList
from modules.cache import Cache
from modules.convert import Convert
from modules.fl... | none | 1 | 2.016889 | 2 | |
z3/music_men.py | Wikunia/hakank | 279 | 6626426 | <filename>z3/music_men.py<gh_stars>100-1000
#!/usr/bin/python -u
# -*- coding: latin-1 -*-
#
# Music men puzzle in Z3
#
# From
## http://groups.google.com/groups?q=FINITE+DOMAINS+With+Logic+Puzzles&hl=en&lr=&ie=UTF-8&c2coff=1&safe=off&selm=1992Jul27.034607.19386#40IRO.UMontreal.CA&rnum=4
# """"
# MUSIC MEN
#
# Three f... | <filename>z3/music_men.py<gh_stars>100-1000
#!/usr/bin/python -u
# -*- coding: latin-1 -*-
#
# Music men puzzle in Z3
#
# From
## http://groups.google.com/groups?q=FINITE+DOMAINS+With+Logic+Puzzles&hl=en&lr=&ie=UTF-8&c2coff=1&safe=off&selm=1992Jul27.034607.19386#40IRO.UMontreal.CA&rnum=4
# """"
# MUSIC MEN
#
# Three f... | en | 0.855715 | #!/usr/bin/python -u # -*- coding: latin-1 -*- # # Music men puzzle in Z3 # # From ## http://groups.google.com/groups?q=FINITE+DOMAINS+With+Logic+Puzzles&hl=en&lr=&ie=UTF-8&c2coff=1&safe=off&selm=1992Jul27.034607.19386#40IRO.UMontreal.CA&rnum=4 # """" # MUSIC MEN # # Three friends like different kinds of music. From t... | 3.090206 | 3 |
networkx/algorithms/connectivity/disjoint_paths.py | FrancescoBonacina/networkx | 10 | 6626427 | """Flow based node and edge disjoint paths."""
import networkx as nx
from networkx.exception import NetworkXNoPath
# Define the default maximum flow function to use for the undelying
# maximum flow computations
from networkx.algorithms.flow import edmonds_karp
from networkx.algorithms.flow import preflow_push
from netw... | """Flow based node and edge disjoint paths."""
import networkx as nx
from networkx.exception import NetworkXNoPath
# Define the default maximum flow function to use for the undelying
# maximum flow computations
from networkx.algorithms.flow import edmonds_karp
from networkx.algorithms.flow import preflow_push
from netw... | en | 0.843497 | Flow based node and edge disjoint paths. # Define the default maximum flow function to use for the undelying # maximum flow computations # Functions to build auxiliary data structures. Returns the edges disjoint paths between source and target. Edge disjoint paths are paths that do not share any edge. The numb... | 3.371452 | 3 |
controllers/msg.py | annehaley/eden | 205 | 6626428 | # -*- coding: utf-8 -*-
"""
Messaging Module - Controllers
"""
if not settings.has_module(c):
raise HTTP(404, body="Module disabled: %s" % c)
# -----------------------------------------------------------------------------
def index():
""" Module's Home Page """
module_name = settings.modules[c].get(... | # -*- coding: utf-8 -*-
"""
Messaging Module - Controllers
"""
if not settings.has_module(c):
raise HTTP(404, body="Module disabled: %s" % c)
# -----------------------------------------------------------------------------
def index():
""" Module's Home Page """
module_name = settings.modules[c].get(... | en | 0.494841 | # -*- coding: utf-8 -*- Messaging Module - Controllers # ----------------------------------------------------------------------------- Module's Home Page # ----------------------------------------------------------------------------- RESTful CRUD controller for Base Stations # Pre-processor # Function to call for all S... | 2.257166 | 2 |
pywal/colors.py | ekkkkkknoes/pywal | 1 | 6626429 | """
Generate a palette using various backends.
"""
import logging
import os
import random
import re
import sys
from . import theme
from . import util
from .settings import CACHE_DIR, MODULE_DIR, __cache_version__
def list_backends():
"""List color backends."""
return [b.name.replace(".py", "") for b in
... | """
Generate a palette using various backends.
"""
import logging
import os
import random
import re
import sys
from . import theme
from . import util
from .settings import CACHE_DIR, MODULE_DIR, __cache_version__
def list_backends():
"""List color backends."""
return [b.name.replace(".py", "") for b in
... | en | 0.709948 | Generate a palette using various backends. List color backends. Convert list of colors to pywal format. Generic color adjustment for themers. Saturate all colors. Create the cache file name. Figure out which backend to use. Generate a palette from the colors. Generate a palette. # home_dylan_img_jpg_backend_1.2.2.json ... | 2.485282 | 2 |
setup.py | dario-alv-bubbling/bubbling_firebase_authentication | 0 | 6626430 | from setuptools import setup
install_requires = [
"firebase-admin>=4.4.0"
]
setup(
install_requires=install_requires,
)
| from setuptools import setup
install_requires = [
"firebase-admin>=4.4.0"
]
setup(
install_requires=install_requires,
)
| none | 1 | 1.097252 | 1 | |
deploy/pptracking/python/visualize.py | leakyH/PaddleDetection | 3 | 6626431 | # Copyright (c) 2021 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) 2021 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.680171 | # Copyright (c) 2021 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.409857 | 2 |
docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/grpc/hello_world_server.py | gky360/opentelemetry-python | 0 | 6626432 | #!/usr/bin/env python
# Copyright The OpenTelemetry 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 applicabl... | #!/usr/bin/env python
# Copyright The OpenTelemetry 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 applicabl... | en | 0.667285 | #!/usr/bin/env python # Copyright The OpenTelemetry 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 applicabl... | 1.785465 | 2 |
general/views.py | VladaDidko/skill- | 0 | 6626433 | <gh_stars>0
from django.shortcuts import render
from blog.models import Category, Post
from django.http import HttpResponse
from users.models import Profile, Follower
from django.contrib.auth.models import User
def home(request):
current_user = request.user
followers = Follower.objects.all().filter(follower__in=User... | from django.shortcuts import render
from blog.models import Category, Post
from django.http import HttpResponse
from users.models import Profile, Follower
from django.contrib.auth.models import User
def home(request):
current_user = request.user
followers = Follower.objects.all().filter(follower__in=User.objects.fil... | none | 1 | 2.113439 | 2 | |
oneview_redfish_toolkit/api/processor.py | AgneshKumar/oneview-redfish-toolkit | 19 | 6626434 | <filename>oneview_redfish_toolkit/api/processor.py
# -*- coding: utf-8 -*-
# Copyright (2018) Hewlett Packard Enterprise Development LP
#
# 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
#
# ht... | <filename>oneview_redfish_toolkit/api/processor.py
# -*- coding: utf-8 -*-
# Copyright (2018) Hewlett Packard Enterprise Development LP
#
# 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
#
# ht... | en | 0.804989 | # -*- coding: utf-8 -*- # Copyright (2018) Hewlett Packard Enterprise Development LP # # 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 ... | 2.282249 | 2 |
app/backend/wells/migrations/0125_refactor_inline_sql_export_wells_water_1545.py | bcgov/gwells | 37 | 6626435 | <filename>app/backend/wells/migrations/0125_refactor_inline_sql_export_wells_water_1545.py<gh_stars>10-100
# Generated by Django 2.2.18 on 2021-03-22 18:37
from django.db import migrations
"""
Well V1
note on extra joins:
well_licences: any well having at least 1 licence entry will be marked as Licensed.
"""
... | <filename>app/backend/wells/migrations/0125_refactor_inline_sql_export_wells_water_1545.py<gh_stars>10-100
# Generated by Django 2.2.18 on 2021-03-22 18:37
from django.db import migrations
"""
Well V1
note on extra joins:
well_licences: any well having at least 1 licence entry will be marked as Licensed.
"""
... | en | 0.866175 | # Generated by Django 2.2.18 on 2021-03-22 18:37 Well V1 note on extra joins: well_licences: any well having at least 1 licence entry will be marked as Licensed. create view export_well_v1_view as select well.well_tag_number as well_tag_number, identification_plate_number as identification_plate_numb... | 1.956822 | 2 |
src/sst/elements/Samba/tests/streambench_mmu.py | Xiaoyang-Lu/sst-elements | 2 | 6626436 | <filename>src/sst/elements/Samba/tests/streambench_mmu.py
import sst
# Define SST core options
sst.setProgramOption("timebase", "1ps")
sst.setProgramOption("stopAtCycle", "0 ns")
# Tell SST what statistics handling we want
sst.setStatisticLoadLevel(4)
# Define the simulation components
comp_cpu = sst.Component("cpu"... | <filename>src/sst/elements/Samba/tests/streambench_mmu.py
import sst
# Define SST core options
sst.setProgramOption("timebase", "1ps")
sst.setProgramOption("stopAtCycle", "0 ns")
# Tell SST what statistics handling we want
sst.setStatisticLoadLevel(4)
# Define the simulation components
comp_cpu = sst.Component("cpu"... | en | 0.628216 | # Define SST core options # Tell SST what statistics handling we want # Define the simulation components # Enable statistics outputs # Enable statistics outputs # we assume same link latency of up and down traffic of the link # Define the simulation links arielMMULink = sst.Link("cpu_mmu_link_" + str(next_core_id)) ... | 1.943359 | 2 |
main.py | cleysonsilvame/desafio-cromai-api | 0 | 6626437 | from flask import Flask
from flask_restful import Api, Resource, reqparse
from math import hypot
from flask_cors import CORS
app = Flask(__name__)
api = Api(app)
cors = CORS(app)
parser = reqparse.RequestParser()
class Pitagoras(Resource):
def post(self):
parser.add_argument('opposite_side')
par... | from flask import Flask
from flask_restful import Api, Resource, reqparse
from math import hypot
from flask_cors import CORS
app = Flask(__name__)
api = Api(app)
cors = CORS(app)
parser = reqparse.RequestParser()
class Pitagoras(Resource):
def post(self):
parser.add_argument('opposite_side')
par... | none | 1 | 2.902121 | 3 | |
mosaic.py | surpass19/mosaic | 430 | 6626438 | import sys
import os
from PIL import Image, ImageOps
from multiprocessing import Process, Queue, cpu_count
# Change these 3 config parameters to suit your needs...
TILE_SIZE = 50 # height/width of mosaic tiles in pixels
TILE_MATCH_RES = 5 # tile matching resolution (higher values give better fit but require mor... | import sys
import os
from PIL import Image, ImageOps
from multiprocessing import Process, Queue, cpu_count
# Change these 3 config parameters to suit your needs...
TILE_SIZE = 50 # height/width of mosaic tiles in pixels
TILE_MATCH_RES = 5 # tile matching resolution (higher values give better fit but require mor... | en | 0.870116 | # Change these 3 config parameters to suit your needs... # height/width of mosaic tiles in pixels # tile matching resolution (higher values give better fit but require more processing) # the mosaic image will be this many times wider and taller than the original # tiles must be square, so get the largest square that fi... | 2.824352 | 3 |
homeassistant/components/ozw/migration.py | tbarbette/core | 11 | 6626439 | <filename>homeassistant/components/ozw/migration.py
"""Provide tools for migrating from the zwave integration."""
from homeassistant.helpers.device_registry import (
async_get_registry as async_get_device_registry,
)
from homeassistant.helpers.entity_registry import (
async_entries_for_config_entry,
async_g... | <filename>homeassistant/components/ozw/migration.py
"""Provide tools for migrating from the zwave integration."""
from homeassistant.helpers.device_registry import (
async_get_registry as async_get_device_registry,
)
from homeassistant.helpers.entity_registry import (
async_entries_for_config_entry,
async_g... | en | 0.750447 | Provide tools for migrating from the zwave integration. # The following dicts map labels between OpenZWave 1.4 and 1.6. Return dict with ozw side migration info. # ozw only has a single config entry Map zwave node values onto ozw node values. # Save the zwave_entry under the ozw entity_id to create the map. # Check tha... | 1.767409 | 2 |
test/test-acl.py | umeshpacholi/iudx-auth-server | 0 | 6626440 | <gh_stars>0
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
from init import provider
rules = [
'<EMAIL> can access rs1.com/x/y/z/t/a/b/c for 2 days',
'<EMAIL> can access rs1.com/_x/y/z/t/a/b/c for 2 days if country = "IN" AND api = "/latest"',
'<EMAIL> can access rs1.com/x-t/y/z/t/a/b/c for 2 days if count... | # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
from init import provider
rules = [
'<EMAIL> can access rs1.com/x/y/z/t/a/b/c for 2 days',
'<EMAIL> can access rs1.com/_x/y/z/t/a/b/c for 2 days if country = "IN" AND api = "/latest"',
'<EMAIL> can access rs1.com/x-t/y/z/t/a/b/c for 2 days if country = "IN" OR... | de | 0.26704 | # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 | 1.798536 | 2 |
ee/api/ee_property_definition.py | dorucioclea/posthog | 0 | 6626441 | <filename>ee/api/ee_property_definition.py
from rest_framework import serializers
from ee.models.property_definition import EnterprisePropertyDefinition
from posthog.api.shared import UserBasicSerializer
class EnterprisePropertyDefinitionSerializer(serializers.ModelSerializer):
updated_by = UserBasicSerializer(r... | <filename>ee/api/ee_property_definition.py
from rest_framework import serializers
from ee.models.property_definition import EnterprisePropertyDefinition
from posthog.api.shared import UserBasicSerializer
class EnterprisePropertyDefinitionSerializer(serializers.ModelSerializer):
updated_by = UserBasicSerializer(r... | none | 1 | 2.138018 | 2 | |
software/drift_cali/drift_cali.py | BaharsGit/Rovable | 0 | 6626442 | #!/usr/bin/env python
# work with MPU6050_kalman.ino
from PyQt5 import QtCore, QtWidgets, uic, QtGui
from pyqtgraph import PlotWidget
from PyQt5.QtWidgets import QApplication, QVBoxLayout
import pyqtgraph as pg
import numpy as np
import datetime
import serial
import sys
import os
import time
from time import sleep
fro... | #!/usr/bin/env python
# work with MPU6050_kalman.ino
from PyQt5 import QtCore, QtWidgets, uic, QtGui
from pyqtgraph import PlotWidget
from PyQt5.QtWidgets import QApplication, QVBoxLayout
import pyqtgraph as pg
import numpy as np
import datetime
import serial
import sys
import os
import time
from time import sleep
fro... | en | 0.703977 | #!/usr/bin/env python # work with MPU6050_kalman.ino #Load the UI Page # Ref: https://stackoverflow.com/questions/59898215/break-an-infinit-loop-when-button-is-pressed # sys.platform == 'win32': # clear the list first # clear the list first # delete the \n at the end # Start the timer # Stop the timer # 3 double value:... | 2.300507 | 2 |
mindmeld/components/_config.py | arushir/mindmeld | 0 | 6626443 | <gh_stars>0
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/lice... | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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... | en | 0.594348 | # -*- coding: utf-8 -*- # # Copyright (c) 2015 Cisco Systems, Inc. and others. 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... | 1.533501 | 2 |
jobmonitor/star.py | tvogels/job-monitor | 1 | 6626444 | <reponame>tvogels/job-monitor<filename>jobmonitor/star.py<gh_stars>1-10
#!/usr/bin/env python3
from bson.objectid import ObjectId
import jobmonitor.delete
from jobmonitor.connections import mongo
"""
Kill a job if it is running on kubernetes
"""
def star(job_id):
mongo.job.update_one({"_id": ObjectId(job_id)}... | #!/usr/bin/env python3
from bson.objectid import ObjectId
import jobmonitor.delete
from jobmonitor.connections import mongo
"""
Kill a job if it is running on kubernetes
"""
def star(job_id):
mongo.job.update_one({"_id": ObjectId(job_id)}, {"$set": {"annotations.star": True}})
def main():
jobmonitor.del... | en | 0.45511 | #!/usr/bin/env python3 Kill a job if it is running on kubernetes | 2.371374 | 2 |
jupyter_xprahtml5_proxy/__init__.py | ccha23/jupyter-xprahtml5-proxy | 0 | 6626445 | <reponame>ccha23/jupyter-xprahtml5-proxy<gh_stars>0
import os
import logging
logger = logging.getLogger(__name__)
logger.setLevel('INFO')
HERE = os.path.dirname(os.path.abspath(__file__))
### Why are so many lines commented?
# Currently jupyter-server-proxy does not support url-parameters, yet.
# A pull request is w... | import os
import logging
logger = logging.getLogger(__name__)
logger.setLevel('INFO')
HERE = os.path.dirname(os.path.abspath(__file__))
### Why are so many lines commented?
# Currently jupyter-server-proxy does not support url-parameters, yet.
# A pull request is waiting to be merged: https://github.com/jupyterhub/j... | en | 0.602482 | ### Why are so many lines commented? # Currently jupyter-server-proxy does not support url-parameters, yet. # A pull request is waiting to be merged: https://github.com/jupyterhub/jupyter-server-proxy/pull/226 # Be aware! Until then, we need to comment the support for password and encryption. # def _xprahtml5_urlparams... | 2.205506 | 2 |
onecodex/vendored/potion_client/links.py | jairideout/onecodex | 0 | 6626446 | # flake8: noqa
try:
import simplejson as json
except ImportError:
import json
import re
from requests import Request
from requests.exceptions import HTTPError
from .collection import PaginatedList
from .converter import PotionJSONEncoder, PotionJSONDecoder
from .schema import Schema
class Link(object):
... | # flake8: noqa
try:
import simplejson as json
except ImportError:
import json
import re
from requests import Request
from requests.exceptions import HTTPError
from .collection import PaginatedList
from .converter import PotionJSONEncoder, PotionJSONDecoder
from .schema import Schema
class Link(object):
... | en | 0.808851 | # flake8: noqa # return error for some error conditions # Need to pass positional argument as *arg so that properties of the same name are not overridden in **params. | 2.433381 | 2 |
logicaDeProgramacao/exec3.py | SabrinadeSousa/pythonExercise | 0 | 6626447 | #Faça um programa para imprimir todo o alfabeto uma letra por linha e em
#vai me o alfabeto em forma de triangulo.
for alfa in range(96, 123):
for repete in range(0, (alfa - 96)):
print(chr(alfa), end="")
#esse print vazio vai me da formato de triangulo.
print()
# cada linha deve ter 10 letras repetidas co... | #Faça um programa para imprimir todo o alfabeto uma letra por linha e em
#vai me o alfabeto em forma de triangulo.
for alfa in range(96, 123):
for repete in range(0, (alfa - 96)):
print(chr(alfa), end="")
#esse print vazio vai me da formato de triangulo.
print()
# cada linha deve ter 10 letras repetidas co... | pt | 0.991479 | #Faça um programa para imprimir todo o alfabeto uma letra por linha e em #vai me o alfabeto em forma de triangulo. #esse print vazio vai me da formato de triangulo. # cada linha deve ter 10 letras repetidas com utilização da repetição (for) | 4.257932 | 4 |
deformable_potential_figure/deformable_fig_v2.py | kolbt/whingdingdilly | 4 | 6626448 | '''
A schematic figure to illustrate how Pe (and F_act) sets deformability:
-LJ potential
-Overlay 2 Forces (Strong under week)
-Corresponds to collision angle
'''
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as axes3d
from PIL import Image
import matplotlib.patches... | '''
A schematic figure to illustrate how Pe (and F_act) sets deformability:
-LJ potential
-Overlay 2 Forces (Strong under week)
-Corresponds to collision angle
'''
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as axes3d
from PIL import Image
import matplotlib.patches... | en | 0.481546 | A schematic figure to illustrate how Pe (and F_act) sets deformability: -LJ potential -Overlay 2 Forces (Strong under week) -Corresponds to collision angle # Compute the weak and strong collision force # Plot the figure # single-column figure width #ax.append(fig.add_subplot(131)) # left... | 2.550203 | 3 |
tweet/twitterspidertest/useapi.py | Octoberr/swm0920 | 2 | 6626449 | <reponame>Octoberr/swm0920
"""
实在是莫得法了,用用api
create by judy 2019/09/10
"""
| """
实在是莫得法了,用用api
create by judy 2019/09/10
""" | en | 0.213526 | 实在是莫得法了,用用api create by judy 2019/09/10 | 0.899537 | 1 |
examples/symmetrical_torque_driven_ocp/symmetry_by_constraint.py | vennand/BiorbdOptim | 0 | 6626450 | <gh_stars>0
import biorbd
from bioptim import (
Node,
OptimalControlProgram,
DynamicsTypeList,
DynamicsType,
ObjectiveList,
Objective,
ConstraintList,
Constraint,
BoundsList,
QAndQDotBounds,
InitialGuessList,
ShowResult,
OdeSolver,
)
def prepare_ocp(biorbd_model_pa... | import biorbd
from bioptim import (
Node,
OptimalControlProgram,
DynamicsTypeList,
DynamicsType,
ObjectiveList,
Objective,
ConstraintList,
Constraint,
BoundsList,
QAndQDotBounds,
InitialGuessList,
ShowResult,
OdeSolver,
)
def prepare_ocp(biorbd_model_path="cubeSym.... | en | 0.74444 | # --- Options --- # # Model path # Problem parameters # Add objective functions # Dynamics # Constraints # Path constraint # Initial guess # Define control path constraint # ------------- # # --- Solve the program --- # # --- Show results --- # | 2.340724 | 2 |