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 |
|---|---|---|---|---|---|---|---|---|---|---|
Houdini/Handlers/Play/Item.py | amrmashriqi/Houdini | 0 | 6631951 | from beaker.cache import cache_region as Cache, region_invalidate as Invalidate
from Houdini.Handlers import Handlers, XT
from Houdini.Handlers.Play.Moderation import cheatBan
from Houdini.Data.Penguin import Inventory
cardStarterDeckId = 821
fireBoosterDeckId = 8006
waterBoosterDeckId = 8010
boosterDecks = {
ca... | from beaker.cache import cache_region as Cache, region_invalidate as Invalidate
from Houdini.Handlers import Handlers, XT
from Houdini.Handlers.Play.Moderation import cheatBan
from Houdini.Data.Penguin import Inventory
cardStarterDeckId = 821
fireBoosterDeckId = 8006
waterBoosterDeckId = 8010
boosterDecks = {
ca... | none | 1 | 2.224509 | 2 | |
ED/TP1/ED - 5/model/Dimension.py | lengors/ua-repository | 0 | 6631952 | <reponame>lengors/ua-repository<gh_stars>0
class Dimension:
@classmethod
def get(cls, argument):
if not hasattr(cls, 'REGISTERED'):
setattr(cls, 'REGISTERED', dict())
registered = cls.REGISTERED
value = registered.get(argument, None)
if value is None:
regi... | class Dimension:
@classmethod
def get(cls, argument):
if not hasattr(cls, 'REGISTERED'):
setattr(cls, 'REGISTERED', dict())
registered = cls.REGISTERED
value = registered.get(argument, None)
if value is None:
registered[argument] = value = cls.make(argumen... | none | 1 | 2.975839 | 3 | |
scripts/utils.py | jaeminsung/ml_stock_trading | 0 | 6631953 | <reponame>jaeminsung/ml_stock_trading
import os
import pandas as pd
def write_csv_file(data_df, stock, filename, include_header=False):
curDir = os.path.dirname(__file__)
stock_data_dir = 'data/{}'.format(stock)
filepath = os.path.join(curDir, os.pardir, stock_data_dir)
if not os.path.exists(filepath)... | import os
import pandas as pd
def write_csv_file(data_df, stock, filename, include_header=False):
curDir = os.path.dirname(__file__)
stock_data_dir = 'data/{}'.format(stock)
filepath = os.path.join(curDir, os.pardir, stock_data_dir)
if not os.path.exists(filepath):
os.mkdir(filepath)
path_... | en | 0.550162 | # NEED TO HANDLE ERROR IF START_DATE >= END_DATE | 2.955957 | 3 |
aicup-python/model/vec2_double.py | arijitgupta42/RAIC-2019 | 0 | 6631954 | <filename>aicup-python/model/vec2_double.py
class Vec2Double:
def __init__(self, x, y):
self.x = x
self.y = y
@staticmethod
def read_from(stream):
x = stream.read_double()
y = stream.read_double()
return Vec2Double(x, y)
def write_to(self, stream):
stream.... | <filename>aicup-python/model/vec2_double.py
class Vec2Double:
def __init__(self, x, y):
self.x = x
self.y = y
@staticmethod
def read_from(stream):
x = stream.read_double()
y = stream.read_double()
return Vec2Double(x, y)
def write_to(self, stream):
stream.... | none | 1 | 2.809334 | 3 | |
model/attngan_modules.py | Hhhhhhhhhhao/I2T2I | 0 | 6631955 | <reponame>Hhhhhhhhhhao/I2T2I
import torch
import torch.nn as nn
import torch.nn.parallel
from torch.autograd import Variable
import torch.nn.functional as F
from base import BaseModel
from model.global_attention_modules import GlobalAttentionGeneral as ATT_NET
n_gpu = torch.cuda.device_count()
device = torch.device('... | import torch
import torch.nn as nn
import torch.nn.parallel
from torch.autograd import Variable
import torch.nn.functional as F
from base import BaseModel
from model.global_attention_modules import GlobalAttentionGeneral as ATT_NET
n_gpu = torch.cuda.device_count()
device = torch.device('cuda:0' if n_gpu > 0 else 'cp... | en | 0.398733 | # Upsale the spatial size by a factor of 2 # Keep the spatial size # ############## G networks ################### # mean = mean.to(device) # log_var = log_var.to(device) # cfg.TEXT.EMBEDDING_DIM :param z_code: batch x cfg.GAN.Z_DIM :param c_code: batch x cfg.TEXT.EMBEDDING_DIM :return: batch x ngf/16 x... | 2.482288 | 2 |
Backup/20190721144404/sublime_lib/st3/sublime_lib/flags.py | altundasbatu/SublimeTextSettings | 0 | 6631956 | """
Python enumerations for use with Sublime API methods.
In addition to the standard behavior,
these enumerations' constructors accept the name of an enumerated value as a string:
.. code-block:: python
>>> PointClass(sublime.DIALOG_YES)
<DialogResult.YES: 1>
>>> PointClass("YES")
<DialogResult.YES: 1>
... | """
Python enumerations for use with Sublime API methods.
In addition to the standard behavior,
these enumerations' constructors accept the name of an enumerated value as a string:
.. code-block:: python
>>> PointClass(sublime.DIALOG_YES)
<DialogResult.YES: 1>
>>> PointClass("YES")
<DialogResult.YES: 1>
... | en | 0.465168 | Python enumerations for use with Sublime API methods. In addition to the standard behavior, these enumerations' constructors accept the name of an enumerated value as a string: .. code-block:: python >>> PointClass(sublime.DIALOG_YES) <DialogResult.YES: 1> >>> PointClass("YES") <DialogResult.YES: 1> Des... | 3.102609 | 3 |
osbuild/util/linux.py | jelly/osbuild | 0 | 6631957 | <reponame>jelly/osbuild
"""Linux API Access
This module provides access to linux system-calls and other APIs, in particular
those not provided by the python standard library. The idea is to provide
universal wrappers with broad access to linux APIs. Convenience helpers and
higher-level abstractions are beyond the scop... | """Linux API Access
This module provides access to linux system-calls and other APIs, in particular
those not provided by the python standard library. The idea is to provide
universal wrappers with broad access to linux APIs. Convenience helpers and
higher-level abstractions are beyond the scope of this module.
In so... | en | 0.796434 | Linux API Access This module provides access to linux system-calls and other APIs, in particular those not provided by the python standard library. The idea is to provide universal wrappers with broad access to linux APIs. Convenience helpers and higher-level abstractions are beyond the scope of this module. In some ... | 2.317634 | 2 |
src/main/python/client/gui.py | mwintersperger-tgm/sew5-simple-user-database-mwintersperger-tgm | 0 | 6631958 | import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import requests
class App(QWidget):
def __init__(self):
self.usernameValue = None
self.emailValue = None
self.photoValue = None
super().__init__()
self.title = 'Simple User Databa... | import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import requests
class App(QWidget):
def __init__(self):
self.usernameValue = None
self.emailValue = None
self.photoValue = None
super().__init__()
self.title = 'Simple User Databa... | en | 0.454963 | # Add box layout, add table to box layout and add box layout to widget # Show widget # Create table | 2.683288 | 3 |
whisky/pipeline.py | underscorenygren/slick | 1 | 6631959 | from whisky import items
class WhiskyItemPipeline(object):
"""fills whisky items fields from name by default"""
def process_item(self, the_item, spider):
if isinstance(the_item, items.WhiskyItem):
the_item = items.fill_item_from_name(the_item)
return the_item
| from whisky import items
class WhiskyItemPipeline(object):
"""fills whisky items fields from name by default"""
def process_item(self, the_item, spider):
if isinstance(the_item, items.WhiskyItem):
the_item = items.fill_item_from_name(the_item)
return the_item
| en | 0.579308 | fills whisky items fields from name by default | 2.973101 | 3 |
models/kitti/frustum/__init__.py | Masterchef365/pvcnn | 477 | 6631960 | from models.kitti.frustum.frustum_net import FrustumPointNet, FrustumPointNet2, FrustumPVCNNE
| from models.kitti.frustum.frustum_net import FrustumPointNet, FrustumPointNet2, FrustumPVCNNE
| none | 1 | 1.110027 | 1 | |
src/pattern_manager/__init__.py | SysDesignSrl/pattern_manager | 0 | 6631961 | #!/usr/bin/env python
from pattern_manager.xform import XForm
from pattern_manager.util import handle_input_1d, matrix_to_tf, publish_markers, broadcast_transforms
from pattern_manager.plugin import Plugin, PluginLoader
| #!/usr/bin/env python
from pattern_manager.xform import XForm
from pattern_manager.util import handle_input_1d, matrix_to_tf, publish_markers, broadcast_transforms
from pattern_manager.plugin import Plugin, PluginLoader
| ru | 0.26433 | #!/usr/bin/env python | 1.037628 | 1 |
xos/tools/openstack-healthcheck.py | mary-grace/xos | 66 | 6631962 | # Copyright 2017-present Open Networking Foundation
#
# 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 agr... | # Copyright 2017-present Open Networking Foundation
#
# 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 agr... | en | 0.83161 | # Copyright 2017-present Open Networking Foundation # # 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 agr... | 1.985449 | 2 |
repos/system_upgrade/el7toel8/actors/firewalldfactsactor/actor.py | Jakuje/leapp-repository | 0 | 6631963 | <gh_stars>0
from leapp.actors import Actor
from leapp.models import FirewalldFacts
from leapp.tags import FactsPhaseTag, IPUWorkflowTag
from leapp.libraries.actor import private
import os
import xml.etree.ElementTree as ElementTree
class FirewalldFactsActor(Actor):
"""
Provide data about firewalld
Afte... | from leapp.actors import Actor
from leapp.models import FirewalldFacts
from leapp.tags import FactsPhaseTag, IPUWorkflowTag
from leapp.libraries.actor import private
import os
import xml.etree.ElementTree as ElementTree
class FirewalldFactsActor(Actor):
"""
Provide data about firewalld
After collecting... | en | 0.786997 | Provide data about firewalld After collecting data, a message with relevant data will be produced. | 2.410572 | 2 |
tests/test_geocoding.py | hasan-haider/conrad | 244 | 6631964 | # -*- coding: utf-8 -*-
from conrad.utils import get_address
NYC_ADDRESS = {
"amenity": "New York City Hall",
"house_number": "260",
"road": "Broadway",
"neighbourhood": "Civic Center",
"suburb": "Manhattan",
"city": "Manhattan Community Board 1",
"county": "New York County",
"state":... | # -*- coding: utf-8 -*-
from conrad.utils import get_address
NYC_ADDRESS = {
"amenity": "New York City Hall",
"house_number": "260",
"road": "Broadway",
"neighbourhood": "Civic Center",
"suburb": "Manhattan",
"city": "Manhattan Community Board 1",
"county": "New York County",
"state":... | en | 0.769321 | # -*- coding: utf-8 -*- | 3.537081 | 4 |
frontend/auth_providers/ustc.py | zzh1996/hackergame | 0 | 6631965 | <gh_stars>0
from urllib.parse import urlencode
from urllib.request import urlopen
from urllib.error import URLError
from xml.etree import ElementTree
import logging
from django.contrib import messages
from django.shortcuts import redirect
from django.urls import path
from .base import BaseLoginView
logger = logging... | from urllib.parse import urlencode
from urllib.request import urlopen
from urllib.error import URLError
from xml.etree import ElementTree
import logging
from django.contrib import messages
from django.shortcuts import redirect
from django.urls import path
from .base import BaseLoginView
logger = logging.getLogger(_... | none | 1 | 2.324174 | 2 | |
scripts/svm_classifier_2d.py | vipavlovic/pyprobml | 4,895 | 6631966 | <filename>scripts/svm_classifier_2d.py<gh_stars>1000+
# SVM for binary classification in 2d
# Code is based on
# https://github.com/ageron/handson-ml2/blob/master/05_support_vector_machines.ipynb
import superimport
import numpy as np
import matplotlib.pyplot as plt
import pyprobml_utils as pml
from sklearn.svm impo... | <filename>scripts/svm_classifier_2d.py<gh_stars>1000+
# SVM for binary classification in 2d
# Code is based on
# https://github.com/ageron/handson-ml2/blob/master/05_support_vector_machines.ipynb
import superimport
import numpy as np
import matplotlib.pyplot as plt
import pyprobml_utils as pml
from sklearn.svm impo... | en | 0.82471 | # SVM for binary classification in 2d # Code is based on # https://github.com/ageron/handson-ml2/blob/master/05_support_vector_machines.ipynb ### # Linear SVC with poly degree features ### # RBF kernel with different hparams | 2.928514 | 3 |
kyleandemily/rsvp/translate_guestlist.py | ehayne/KyleAndEmily | 0 | 6631967 | <gh_stars>0
import json
DB = []
PERSON_COUNT = 0
def split_name(guest_info):
return guest_info.split()
def add_guest(guest_info, invitation_count):
global PERSON_COUNT, DB
PERSON_COUNT += 1
first_name, last_name = split_name(guest_info)
person_fields = {
'invitation': invitation_count... | import json
DB = []
PERSON_COUNT = 0
def split_name(guest_info):
return guest_info.split()
def add_guest(guest_info, invitation_count):
global PERSON_COUNT, DB
PERSON_COUNT += 1
first_name, last_name = split_name(guest_info)
person_fields = {
'invitation': invitation_count,
'f... | none | 1 | 2.852741 | 3 | |
tests/settings.py | augustomen/django-celery | 0 | 6631968 | <reponame>augustomen/django-celery<filename>tests/settings.py
# Django settings for testproj project.
import os
import sys
import warnings
warnings.filterwarnings(
'error', r'DateTimeField received a naive datetime',
RuntimeWarning, r'django\.db\.models\.fields')
# import source code dir
here = os.path.abspat... | # Django settings for testproj project.
import os
import sys
import warnings
warnings.filterwarnings(
'error', r'DateTimeField received a naive datetime',
RuntimeWarning, r'django\.db\.models\.fields')
# import source code dir
here = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, here)
sys.path... | en | 0.370075 | # Django settings for testproj project. # import source code dir # noqa # ('<NAME>', '<EMAIL>'), | 1.787024 | 2 |
src/unet/model_predict.py | mschoema/Type-Design-Project | 1 | 6631969 | <reponame>mschoema/Type-Design-Project<filename>src/unet/model_predict.py
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import tensorflow as tf
import argparse
from unet import UNet
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
parser = argparse.ArgumentPa... | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import tensorflow as tf
import argparse
from unet import UNet
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
parser = argparse.ArgumentParser(description='Prediction for unseen data')
parser.add_argument('--mode... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.077402 | 2 |
backend/repositories/migrations/0006_repository_hook_id.py | kevenleone/github-commits | 2 | 6631970 | # Generated by Django 2.2.7 on 2019-12-01 18:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('repositories', '0005_auto_20191124_1640'),
]
operations = [
migrations.AddField(
model_name='repository',
name='hook... | # Generated by Django 2.2.7 on 2019-12-01 18:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('repositories', '0005_auto_20191124_1640'),
]
operations = [
migrations.AddField(
model_name='repository',
name='hook... | en | 0.827194 | # Generated by Django 2.2.7 on 2019-12-01 18:58 | 1.438356 | 1 |
Birnn_Transformer/ncc/criterions/type_prediction/type_prediction_cross_entropy.py | code-backdoor/code-backdoor | 71 | 6631971 | # 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 torch
import torch.nn.functional as F
from ncc.criterions import NccCriterion, register_criterion
from ncc.utils.logging import metric... | # 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 torch
import torch.nn.functional as F
from ncc.criterions import NccCriterion, register_criterion
from ncc.utils.logging import metric... | en | 0.400486 | # 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. Compute the loss for the given sample. Returns a tuple with three elements: 1) the loss 2) the sample size, which is u... | 2.574391 | 3 |
tests/integration/paddle/test_tail_and_tune.py | jina-ai/finetuner | 270 | 6631972 | import paddle.nn as nn
import pytest
from finetuner import fit
@pytest.fixture
def embed_model():
return nn.Sequential(
nn.Flatten(),
nn.Linear(in_features=128, out_features=256),
nn.ReLU(),
nn.Linear(in_features=256, out_features=128),
nn.ReLU(),
nn.Linear(in_feat... | import paddle.nn as nn
import pytest
from finetuner import fit
@pytest.fixture
def embed_model():
return nn.Sequential(
nn.Flatten(),
nn.Linear(in_features=128, out_features=256),
nn.ReLU(),
nn.Linear(in_features=256, out_features=128),
nn.ReLU(),
nn.Linear(in_feat... | none | 1 | 2.44483 | 2 | |
chat/insert.py | nazmul-pro/py-channels | 0 | 6631973 | <gh_stars>0
from django.http import HttpResponse
import jwt, json
from testapp.models import AppUser, AppUserInfo, AppUserToken
def users(request):
users_json = """
[
{
"name": "Sumon",
"email": "<EMAIL>",
"phone": "555",
"password"... | from django.http import HttpResponse
import jwt, json
from testapp.models import AppUser, AppUserInfo, AppUserToken
def users(request):
users_json = """
[
{
"name": "Sumon",
"email": "<EMAIL>",
"phone": "555",
"password": "<PASSWORD... | en | 0.359902 | [ { "name": "Sumon", "email": "<EMAIL>", "phone": "555", "password": "<PASSWORD>" }, { "name": "shadhin", "email": "<EMAIL>", "phone": "555", "password": "<... | 2.604843 | 3 |
tensorflow/python/autograph/utils/testing.py | yage99/tensorflow | 4 | 6631974 | <gh_stars>1-10
# Copyright 2017 The TensorFlow 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 requ... | # Copyright 2017 The TensorFlow 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 applica... | en | 0.781901 | # Copyright 2017 The TensorFlow 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 applica... | 2.7433 | 3 |
codes/server.py | Kevinmuahahaha/posty | 0 | 6631975 | <filename>codes/server.py
from mod.modlog import debug
from mod.interaction_routine import interaction_routine
import threading
import sys
import socket
HOST_IP="127.0.0.1"
HOST_PORT=23869
soc = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
soc.bind((HOST_IP,... | <filename>codes/server.py
from mod.modlog import debug
from mod.interaction_routine import interaction_routine
import threading
import sys
import socket
HOST_IP="127.0.0.1"
HOST_PORT=23869
soc = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
soc.bind((HOST_IP,... | none | 1 | 2.539958 | 3 | |
google/cloud/dlp_v2/services/dlp_service/client.py | anukaal/python-dlp | 32 | 6631976 | <reponame>anukaal/python-dlp
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | en | 0.738998 | # -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or... | 1.456275 | 1 |
heatsim2/boundary_insulating.py | isuthermography/heatsim2 | 2 | 6631977 |
def qx(kmat55m,kmat55p,
dz,dy,dx,
T55m,T55p,
T45m,T45p,
T65m,T65p,
T54m,T54p,
T56m,T56p,
T46m,T46p,
T64m,T64p):
return 0.0
def qy(kmat5m5,kmat5p5,
dz,dy,dx,
T5m5,T5p5,
T4m5,T4p5,
T6m5,T6p5,
T5m4,T5p4,
T5m6,T5p6,
... |
def qx(kmat55m,kmat55p,
dz,dy,dx,
T55m,T55p,
T45m,T45p,
T65m,T65p,
T54m,T54p,
T56m,T56p,
T46m,T46p,
T64m,T64p):
return 0.0
def qy(kmat5m5,kmat5p5,
dz,dy,dx,
T5m5,T5p5,
T4m5,T4p5,
T6m5,T6p5,
T5m4,T5p4,
T5m6,T5p6,
... | none | 1 | 1.890569 | 2 | |
mmseg/models/backbones/vit_mae.py | Eiphodos/SwinSemanticSegmentation | 1 | 6631978 | <reponame>Eiphodos/SwinSemanticSegmentation<filename>mmseg/models/backbones/vit_mae.py<gh_stars>1-10
import torch
from torch import nn
from einops import rearrange, repeat
from einops.layers.torch import Rearrange
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
from mmcv_custom import load_checkpoin... | import torch
from torch import nn
from einops import rearrange, repeat
from einops.layers.torch import Rearrange
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
from mmcv_custom import load_checkpoint
from mmseg.utils import get_root_logger
from ..builder import BACKBONES
# helpers
def pair(t):
... | en | 0.54028 | # helpers # classes # 2*Wh-1 * 2*Ww-1, nH # cls to token & token 2 cls & cls to cls # get pair-wise relative position index for each token inside the window # 2, Wh, Ww # 2, Wh*Ww # 2, Wh*Ww, Wh*Ww # Wh*Ww, Wh*Ww, 2 # shift to start from 0 # Wh*Ww, Wh*Ww # trunc_normal_(self.relative_position_bias_table, std=.0) # Wh*W... | 1.820077 | 2 |
tests/bugs/core_2579_test.py | reevespaul/firebird-qa | 1 | 6631979 | #coding:utf-8
#
# id: bugs.core_2579
# title: Parameters and variables cannot be used as expressions in EXECUTE PROCEDURE parameters without a colon prefix
# decription:
# tracker_id: CORE-2579
# min_versions: []
# versions: 2.5.0
# qmid: None
import pytest
from firebird.qa import db_... | #coding:utf-8
#
# id: bugs.core_2579
# title: Parameters and variables cannot be used as expressions in EXECUTE PROCEDURE parameters without a colon prefix
# decription:
# tracker_id: CORE-2579
# min_versions: []
# versions: 2.5.0
# qmid: None
import pytest
from firebird.qa import db_... | en | 0.60055 | #coding:utf-8 # # id: bugs.core_2579 # title: Parameters and variables cannot be used as expressions in EXECUTE PROCEDURE parameters without a colon prefix # decription: # tracker_id: CORE-2579 # min_versions: [] # versions: 2.5.0 # qmid: None # version: 2.5.0 # resources: None set term ^... | 1.467499 | 1 |
nimbus/nimbus.py | sidmohite/nimbus-astro | 6 | 6631980 | """
The main module of nimbus that sets up the Bayesian formalism.
Classes:
Kilonova_Inference
"""
__author__ = '<NAME>'
import numpy as np
from scipy.stats import norm, truncnorm
from scipy.integrate import quad
from scipy.special import expit
from multiprocessing import Pool
from functools import partial
cla... | """
The main module of nimbus that sets up the Bayesian formalism.
Classes:
Kilonova_Inference
"""
__author__ = '<NAME>'
import numpy as np
from scipy.stats import norm, truncnorm
from scipy.integrate import quad
from scipy.special import expit
from multiprocessing import Pool
from functools import partial
cla... | en | 0.68593 | The main module of nimbus that sets up the Bayesian formalism. Classes: Kilonova_Inference Initializes utility functions for inference and defines the model. Attributes ---------- lc_model_funcs : array-like The array whose elements are band-specific functions that define the light-curve evo... | 2.739511 | 3 |
granule_ingester/tests/processors/test_ForceAscendingLatitude.py | skorper/incubator-sdap-ingester | 0 | 6631981 | <gh_stars>0
import unittest
import xarray as xr
import numpy as np
from os import path
from nexusproto import DataTile_pb2 as nexusproto
from nexusproto.serialization import from_shaped_array, to_shaped_array
from granule_ingester.processors import ForceAscendingLatitude
from granule_ingester.processors.reading_proc... | import unittest
import xarray as xr
import numpy as np
from os import path
from nexusproto import DataTile_pb2 as nexusproto
from nexusproto.serialization import from_shaped_array, to_shaped_array
from granule_ingester.processors import ForceAscendingLatitude
from granule_ingester.processors.reading_processors.GridR... | none | 1 | 2.408847 | 2 | |
tests/__init__.py | lisong996/akshare | 4,202 | 6631982 | <filename>tests/__init__.py
# -*- coding:utf-8 -*-
#!/usr/bin/env python
"""
Date: 2019/12/12 18:16
Desc:
"""
| <filename>tests/__init__.py
# -*- coding:utf-8 -*-
#!/usr/bin/env python
"""
Date: 2019/12/12 18:16
Desc:
"""
| en | 0.40024 | # -*- coding:utf-8 -*- #!/usr/bin/env python Date: 2019/12/12 18:16 Desc: | 1.040434 | 1 |
pytensor/ops/__init__.py | xinjli/pyml | 13 | 6631983 | from pytensor.ops.array_ops import *
from pytensor.ops.embedding_ops import *
from pytensor.ops.loss_ops import *
from pytensor.ops.lstm_ops import *
from pytensor.ops.math_ops import *
from pytensor.ops.rnn_ops import *
from pytensor.ops.rnn_util_ops import * | from pytensor.ops.array_ops import *
from pytensor.ops.embedding_ops import *
from pytensor.ops.loss_ops import *
from pytensor.ops.lstm_ops import *
from pytensor.ops.math_ops import *
from pytensor.ops.rnn_ops import *
from pytensor.ops.rnn_util_ops import * | none | 1 | 1.1935 | 1 | |
sdk/python/pulumi_azure/privatelink/get_service.py | aangelisc/pulumi-azure | 0 | 6631984 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | en | 0.803209 | # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** A collection of values returned by getService. The alias is a globally unique name for your private link service which Azure generates f... | 1.626419 | 2 |
modules/api/functional_test/live_tests/internal/status_test.py | slandry90/vinyldns | 333 | 6631985 | <gh_stars>100-1000
import pytest
import time
from hamcrest import *
from vinyldns_python import VinylDNSClient
from vinyldns_context import VinylDNSTestContext
from utils import *
def test_get_status_success(shared_zone_test_context):
"""
Tests that the status endpoint returns the current processing status,... | import pytest
import time
from hamcrest import *
from vinyldns_python import VinylDNSClient
from vinyldns_context import VinylDNSTestContext
from utils import *
def test_get_status_success(shared_zone_test_context):
"""
Tests that the status endpoint returns the current processing status, color, key name an... | en | 0.875443 | Tests that the status endpoint returns the current processing status, color, key name and version Test that updating a zone when processing is disabled does not happen # disable processing # Create changes to make sure we can process after the toggle # attempt to perform an update # attempt to a create a record # Make ... | 2.17536 | 2 |
democracy_club/apps/projects/urls.py | DemocracyClub/Website | 3 | 6631986 | from django.urls import path
from django.urls import reverse_lazy
from django.views.generic import RedirectView, TemplateView
from core.report_helpers.views import MarkdownFileView
app_name = "projects"
urlpatterns = [
path(
"",
TemplateView.as_view(template_name="projects/projects_home.html"),
... | from django.urls import path
from django.urls import reverse_lazy
from django.views.generic import RedirectView, TemplateView
from core.report_helpers.views import MarkdownFileView
app_name = "projects"
urlpatterns = [
path(
"",
TemplateView.as_view(template_name="projects/projects_home.html"),
... | none | 1 | 2.092001 | 2 | |
controller/pbutton_rpi.py | huberthoegl/tsgrain | 1 | 6631987 | <filename>controller/pbutton_rpi.py
'''Pushbuttons on RPi with MCP23017 (I2C)
'''
import mcp23017
# Panelkeys
PB1 = 'PB1'
PB2 = 'PB2'
PB3 = 'PB3'
PB4 = 'PB4'
PB5 = 'PB5'
PB6 = 'PB6'
PB7 = 'PB7'
PBAutoOff = 'PBAutoOff'
MAN_KEYS = (PB1, PB2, PB3, PB4, PB5, PB6, PB7)
def key_to_index(key):
if key == PB1:
r... | <filename>controller/pbutton_rpi.py
'''Pushbuttons on RPi with MCP23017 (I2C)
'''
import mcp23017
# Panelkeys
PB1 = 'PB1'
PB2 = 'PB2'
PB3 = 'PB3'
PB4 = 'PB4'
PB5 = 'PB5'
PB6 = 'PB6'
PB7 = 'PB7'
PBAutoOff = 'PBAutoOff'
MAN_KEYS = (PB1, PB2, PB3, PB4, PB5, PB6, PB7)
def key_to_index(key):
if key == PB1:
r... | en | 0.852322 | Pushbuttons on RPi with MCP23017 (I2C) # Panelkeys # only one instantiation is allowed! The _press() method can be called multiple times, but it calls the callback functions only at the first time. This is a good behaviour when the low-level key fires repeatedly on a longer press duration. # X... | 2.915039 | 3 |
pycharm/module/changefile/__init__.py | jinbao-x/python | 0 | 6631988 | # from . import readfile # 先在init里导入一下模块,先初始化一下,然后,包之外的另外一个文件就可以使用from 包 imoprt *来调用了
# from . import writefile
# __init__
# 1、声明文件夹是个包
# 2、可以做初始化操作
# 3、可以声明__all__影响 from 包 import *导入,在__all__里写的才会导入
# 当然这个init文件也可以想其他普通模块文件内一样,可以使用__all__ = ['readfile']这样的方式来确认模块里的哪些方法可以使用
# 这种是为了解决其他模块文件里用from changefile import ... | # from . import readfile # 先在init里导入一下模块,先初始化一下,然后,包之外的另外一个文件就可以使用from 包 imoprt *来调用了
# from . import writefile
# __init__
# 1、声明文件夹是个包
# 2、可以做初始化操作
# 3、可以声明__all__影响 from 包 import *导入,在__all__里写的才会导入
# 当然这个init文件也可以想其他普通模块文件内一样,可以使用__all__ = ['readfile']这样的方式来确认模块里的哪些方法可以使用
# 这种是为了解决其他模块文件里用from changefile import ... | zh | 0.968314 | # from . import readfile # 先在init里导入一下模块,先初始化一下,然后,包之外的另外一个文件就可以使用from 包 imoprt *来调用了 # from . import writefile # __init__ # 1、声明文件夹是个包 # 2、可以做初始化操作 # 3、可以声明__all__影响 from 包 import *导入,在__all__里写的才会导入 # 当然这个init文件也可以想其他普通模块文件内一样,可以使用__all__ = ['readfile']这样的方式来确认模块里的哪些方法可以使用 # 这种是为了解决其他模块文件里用from changefile import *这种... | 2.066516 | 2 |
tests/test_pipelinetree.py | vsbogd/language-learning | 21 | 6631989 | <gh_stars>10-100
import unittest
from src.pipeline.pipelinetree import PipelineTreeNode2, build_tree, prepare_parameters
config = [
{
'component': 'grammar-learner',
'common-parameters': {
'space': 'connectors-DRK-connectors',
'input_parses': '~/data/parses/POC-Turtle/LG/pa... | import unittest
from src.pipeline.pipelinetree import PipelineTreeNode2, build_tree, prepare_parameters
config = [
{
'component': 'grammar-learner',
'common-parameters': {
'space': 'connectors-DRK-connectors',
'input_parses': '~/data/parses/POC-Turtle/LG/parses',
... | en | 0.043554 | # { # 'component': 'dash-board', # 'common-parameters': { # 'input_grammar': '%PREV/', # 'corpus_path': '%ROOT/aging3.txt', # 'output_path': '%PREV/', # 'linkage_limit': '1000', # 'rm_grammar_dir': True, # 'use_link_parser': True, # 'ull_input': True, # ... | 1.965006 | 2 |
2016/21_scrambled_letters_and_hash_test.py | pchudzik/adventofcode | 0 | 6631990 | import importlib
import pytest
module = importlib.import_module("21_scrambled_letters_and_hash")
parse_cmd = module.parse_cmd
password_generator = module.password_generator
unscrabble_password = module.unscrabble_password
def test_password_generator():
cmds = [
"swap position 4 with position 0",
... | import importlib
import pytest
module = importlib.import_module("21_scrambled_letters_and_hash")
parse_cmd = module.parse_cmd
password_generator = module.password_generator
unscrabble_password = module.unscrabble_password
def test_password_generator():
cmds = [
"swap position 4 with position 0",
... | none | 1 | 2.729848 | 3 | |
url_manager/views.py | haandol/url_shortener | 1 | 6631991 | <filename>url_manager/views.py
#coding: utf-8
import re
import urllib
from models import WrongURL, LongURL, ShortURL
BASE62 = '01234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
nBASE62 = len(BASE62)
PATTERN = r'http://[^/^\s]+[.]\w{2,4}\S/?'
def get_short_id(url):
u'''긴 URL을 받아서 짧은 URL의 id를 반환'''... | <filename>url_manager/views.py
#coding: utf-8
import re
import urllib
from models import WrongURL, LongURL, ShortURL
BASE62 = '01234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
nBASE62 = len(BASE62)
PATTERN = r'http://[^/^\s]+[.]\w{2,4}\S/?'
def get_short_id(url):
u'''긴 URL을 받아서 짧은 URL의 id를 반환'''... | ko | 0.999615 | #coding: utf-8 긴 URL을 받아서 짧은 URL의 id를 반환 아이디를 입력받아 인코딩한다 아이디를 입력받아 인코딩한다 | 2.28553 | 2 |
FAReinforcement/CartPoleDemo.py | jamartinh/ReinforcementLearning | 0 | 6631992 | <reponame>jamartinh/ReinforcementLearning
from rltools.FARLBasic import *
#from Environments.CartPoleEnvironment import CartPoleEnvironment
#from Environments.CartPoleEnvironmentG import CartPoleEnvironment
from Environments.CartPoleEnvironmentGN import CartPoleEnvironment
#from kNNQ import kNNQ
#from rltools.... | from rltools.FARLBasic import *
#from Environments.CartPoleEnvironment import CartPoleEnvironment
#from Environments.CartPoleEnvironmentG import CartPoleEnvironment
from Environments.CartPoleEnvironmentGN import CartPoleEnvironment
#from kNNQ import kNNQ
#from rltools.kNNQC import kNNQC
from rltools.ExaSCIPY ... | en | 0.322041 | #from Environments.CartPoleEnvironment import CartPoleEnvironment #from Environments.CartPoleEnvironmentG import CartPoleEnvironment #from kNNQ import kNNQ #from rltools.kNNQC import kNNQC #from NeuroQ import NeuroQ #from RNeuroQ import RNeuroQ #from SNeuroQ import SNeuroQ #from SOMQ import SOMQ #from pylab import * # ... | 2.175601 | 2 |
watchapp/migrations/0001_initial.py | kepha-okari/the-watch | 0 | 6631993 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-02-09 16:38
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations... | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-02-09 16:38
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations... | en | 0.7577 | # -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-02-09 16:38 | 1.658047 | 2 |
config.py | AdrianM0Hdz/Linkr | 0 | 6631994 | <gh_stars>0
import os
basedir = os.path.abspath(os.path.dirname(__name__))
class Config:
SECRET_KEY = 'PassWdntid&&dddgy234256dsbbdaafssd2dddd'
SQLALCHEMY_TRACK_MODIFICATIONS = False
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
FLASK_DEBUG = True
SQLALCHEMY... | import os
basedir = os.path.abspath(os.path.dirname(__name__))
class Config:
SECRET_KEY = 'PassWdntid&&dddgy234256dsbbdaafssd2dddd'
SQLALCHEMY_TRACK_MODIFICATIONS = False
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
FLASK_DEBUG = True
SQLALCHEMY_DATABASE_UR... | none | 1 | 2.022684 | 2 | |
timm/loss/__init__.py | cxxgtxy/pytorch-image-models | 41 | 6631995 | from .cross_entropy import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy
| from .cross_entropy import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy
| none | 1 | 1.236548 | 1 | |
peeringdb_server/migrations/0039_delete_duplicateipnetworkixlan.py | tbaschak/peeringdb | 0 | 6631996 | # Generated by Django 2.2.13 on 2020-07-08 20:48
from django.db import migrations, models
import django_countries.fields
import django_inet.models
import django_peeringdb.models.abstract
class Migration(migrations.Migration):
dependencies = [
("peeringdb_server", "0038_netixlan_ipaddr_unique"),
]
... | # Generated by Django 2.2.13 on 2020-07-08 20:48
from django.db import migrations, models
import django_countries.fields
import django_inet.models
import django_peeringdb.models.abstract
class Migration(migrations.Migration):
dependencies = [
("peeringdb_server", "0038_netixlan_ipaddr_unique"),
]
... | en | 0.719934 | # Generated by Django 2.2.13 on 2020-07-08 20:48 | 1.536449 | 2 |
data/build_probe_1_data.py | googleinterns/e2e-convrec | 4 | 6631997 | <reponame>googleinterns/e2e-convrec<gh_stars>1-10
# Copyright 2020 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# https://www.apache.org/licenses/LICENSE-2.0
# Unless requi... | # Copyright 2020 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, sof... | en | 0.843384 | # Copyright 2020 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, softwa... | 1.84453 | 2 |
wooey/tests/mixins.py | macdaliot/Wooey | 1 | 6631998 | import shutil
import os
from ..models import ScriptVersion, WooeyFile, WooeyJob
from ..backend import utils
from .. import settings as wooey_settings
from . import factories, config
# TODO: Track down where file handles are not being closed. This is not a problem on Linux/Mac, but is on Windows
# and likely reflects... | import shutil
import os
from ..models import ScriptVersion, WooeyFile, WooeyJob
from ..backend import utils
from .. import settings as wooey_settings
from . import factories, config
# TODO: Track down where file handles are not being closed. This is not a problem on Linux/Mac, but is on Windows
# and likely reflects... | en | 0.959902 | # TODO: Track down where file handles are not being closed. This is not a problem on Linux/Mac, but is on Windows # and likely reflects being careless somewhere as opposed to Windows being a PITA # delete job dirs # import pdb; pdb.set_trace(); # handle pyc junk | 2.012215 | 2 |
checker/layout.py | fausecteam/faustctf-2021-thelostbottle | 0 | 6631999 | <gh_stars>0
import random
import subprocess
import string
def gen_name(x = 10, y = 15):
length = random.randint(x, y)
return "".join(random.choice(string.ascii_letters) for _ in range(length))
# should always print 1 / ..., because we don't shuffle the first
def bottlecheck(bs, target, num = 10000):
ids = list(ran... | import random
import subprocess
import string
def gen_name(x = 10, y = 15):
length = random.randint(x, y)
return "".join(random.choice(string.ascii_letters) for _ in range(length))
# should always print 1 / ..., because we don't shuffle the first
def bottlecheck(bs, target, num = 10000):
ids = list(range(len(bs)))... | en | 0.911941 | # should always print 1 / ..., because we don't shuffle the first # 1. dimension is x (right) ! # sides # top/bot # union-find # for debug only # make connected # rooms a, b target := % value to achieve for success # never enough # just in case # use v = 2 as many as needed # small percent that makes enough progress to... | 2.993709 | 3 |
prosodyextruct.py | EmergentSystemLabStudent/Prosodic-DAA | 0 | 6632000 | import os
import re
import pyreaper
import numpy as np
import matplotlib.pyplot as plt
from python_speech_features import delta as delta_mfcc
from speech_feature_extraction import Extractor
from speech_feature_extraction.util import WavLoader
from scipy.io import wavfile
try:
from tqdm import tqdm
except... | import os
import re
import pyreaper
import numpy as np
import matplotlib.pyplot as plt
from python_speech_features import delta as delta_mfcc
from speech_feature_extraction import Extractor
from speech_feature_extraction.util import WavLoader
from scipy.io import wavfile
try:
from tqdm import tqdm
except... | en | 0.219183 | #x = x[:,1].copy(order='C') #x = x.mean(axis=0) #data = np.pad(sdata, (window, window), mode='edge') # if not os.path.exists("results/WAVE"): # os.mkdir("results/WAVE") # if not os.path.exists("results/figures"): # os.mkdir("results/figures") #aioi_dataset #x, sil, phn, wrd = sil_cut(y, phn, wrd, fs, sil_len=0.... | 2.495966 | 2 |
drop-linux/generate_key.py | ddesmond/clarisse-drop | 5 | 6632001 | <filename>drop-linux/generate_key.py
# author: https://github.com/ddesmond/clarisse-drop
# this file generates youre personal encryption key.
# after you loose it you loose acces to your online repository, so be careful and
# BACKUP THE GENERATED KEY FILE.
import os
from cryptography.fernet import Fernet
if os.path.... | <filename>drop-linux/generate_key.py
# author: https://github.com/ddesmond/clarisse-drop
# this file generates youre personal encryption key.
# after you loose it you loose acces to your online repository, so be careful and
# BACKUP THE GENERATED KEY FILE.
import os
from cryptography.fernet import Fernet
if os.path.... | en | 0.76988 | # author: https://github.com/ddesmond/clarisse-drop # this file generates youre personal encryption key. # after you loose it you loose acces to your online repository, so be careful and # BACKUP THE GENERATED KEY FILE. | 3.043741 | 3 |
daiquiri/conesearch/views.py | agy-why/daiquiri | 14 | 6632002 | <gh_stars>10-100
from django.http import HttpResponse
from daiquiri.core.renderers.voresource import VoresourceRenderer
from daiquiri.core.renderers.vosi import AvailabilityRenderer, CapabilitiesRenderer
from .vo import get_resource, get_availability, get_capabilities
def resource(request):
return HttpResponse(... | from django.http import HttpResponse
from daiquiri.core.renderers.voresource import VoresourceRenderer
from daiquiri.core.renderers.vosi import AvailabilityRenderer, CapabilitiesRenderer
from .vo import get_resource, get_availability, get_capabilities
def resource(request):
return HttpResponse(VoresourceRendere... | none | 1 | 1.880977 | 2 | |
tests/backends/dailymotion_test.py | Diolor/python-social-auth | 1 | 6632003 | import json
from tests.oauth import OAuth2Test
class DailymotionOAuth2Test(OAuth2Test):
backend_path = 'social.backends.dailymotion.DailymotionOAuth2'
user_data_url = 'https://api.dailymotion.com/me/'
expected_username = 'foobar'
access_token_body = json.dumps({
'access_token': 'foobar',
... | import json
from tests.oauth import OAuth2Test
class DailymotionOAuth2Test(OAuth2Test):
backend_path = 'social.backends.dailymotion.DailymotionOAuth2'
user_data_url = 'https://api.dailymotion.com/me/'
expected_username = 'foobar'
access_token_body = json.dumps({
'access_token': 'foobar',
... | none | 1 | 2.437485 | 2 | |
code/venv/lib/python3.8/site-packages/datadog_api_client/v1/model/group_widget_definition.py | Valisback/hiring-engineers | 0 | 6632004 | <reponame>Valisback/hiring-engineers<gh_stars>0
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v1.model_utils... | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v1.model_utils import (
ModelNormal,
cached_property,
... | en | 0.660073 | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2019-Present Datadog, Inc. NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-genera... | 1.679755 | 2 |
vnpy/trader/app/riskManager/__init__.py | ghjan/vnpy | 34 | 6632005 | <reponame>ghjan/vnpy
# encoding: UTF-8
from vnpy.trader.app.riskManager.rmEngine import RmEngine
from vnpy.trader.app.riskManager.uiRmWidget import RmEngineManager
appName = 'RiskManager'
appDisplayName = u'风险管理'
appEngine = RmEngine
appWidget = RmEngineManager
appIco = 'rm.ico' | # encoding: UTF-8
from vnpy.trader.app.riskManager.rmEngine import RmEngine
from vnpy.trader.app.riskManager.uiRmWidget import RmEngineManager
appName = 'RiskManager'
appDisplayName = u'风险管理'
appEngine = RmEngine
appWidget = RmEngineManager
appIco = 'rm.ico' | en | 0.156115 | # encoding: UTF-8 | 1.123078 | 1 |
zapier/exceptions.py | yunojuno/django-zapier-trigger | 1 | 6632006 | <gh_stars>1-10
class TokenAuthError(Exception):
"""Base token authentication/authorisation error."""
pass
class MissingTokenHeader(TokenAuthError):
"""Request is missing the X-Api-Token header."""
pass
class UnknownToken(TokenAuthError):
"""Token does not exist."""
pass
class TokenUserE... | class TokenAuthError(Exception):
"""Base token authentication/authorisation error."""
pass
class MissingTokenHeader(TokenAuthError):
"""Request is missing the X-Api-Token header."""
pass
class UnknownToken(TokenAuthError):
"""Token does not exist."""
pass
class TokenUserError(TokenAuthE... | en | 0.856954 | Base token authentication/authorisation error. Request is missing the X-Api-Token header. Token does not exist. User is inactive, or is not the same as request.user. Token does not have the valid scope. Response does not contain valid JSON. | 2.834357 | 3 |
mupit/write_json_probands.py | jeremymcrae/mup | 4 | 6632007 | """
Copyright (c) 2016 Genome Research Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distr... | """
Copyright (c) 2016 Genome Research Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distr... | en | 0.740675 | Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribut... | 2.082495 | 2 |
main.py | Brfrance/energydatahack | 0 | 6632008 | """Main. Point d'entrer du programme."""
import CNN
import tensorflow as tf
from CNN_data import get_data_sets
physical_devices = tf.config.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(physical_devices[0], True)
TrainX, Trainy, ValidX, Validy, TestX, Testy = get_data_sets(CNN.input_length)
... | """Main. Point d'entrer du programme."""
import CNN
import tensorflow as tf
from CNN_data import get_data_sets
physical_devices = tf.config.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(physical_devices[0], True)
TrainX, Trainy, ValidX, Validy, TestX, Testy = get_data_sets(CNN.input_length)
... | fr | 0.924255 | Main. Point d'entrer du programme. | 2.648436 | 3 |
tests/conftest.py | dued/andamio-base | 0 | 6632009 | import os
from pathlib import Path
import pytest
import yaml
from plumbum import local
from plumbum.cmd import git
with open("copier.yml") as copier_fd:
COPIER_SETTINGS = yaml.safe_load(copier_fd)
# Diferentes tests diferentes versiones de odoo
OLDEST_SUPPORTED_ODOO_VERSION = 8.0
ALL_ODOO_VERSIONS = tuple(COPIER... | import os
from pathlib import Path
import pytest
import yaml
from plumbum import local
from plumbum.cmd import git
with open("copier.yml") as copier_fd:
COPIER_SETTINGS = yaml.safe_load(copier_fd)
# Diferentes tests diferentes versiones de odoo
OLDEST_SUPPORTED_ODOO_VERSION = 8.0
ALL_ODOO_VERSIONS = tuple(COPIER... | es | 0.930951 | # Diferentes tests diferentes versiones de odoo Devuelve cualquier version odoo utilizable. Devuelve cualquier version odoo soportada. Este repositorio clonado a un destino temporal. El clon incluirá cambios sucios y tendrá una etiqueta de 'prueba' en su HEAD. Devuelve el `Path` local al clon. Accesorio para ... | 2.120951 | 2 |
2021/Day 2 - Dive!/1.py | Ashwin-op/Advent_of_Code | 2 | 6632010 | MOVEMENTS = {
'forward': lambda x, y, a: (x + a, y),
'down': lambda x, y, a: (x, y - a),
'up': lambda x, y, a: (x, y + a),
}
with open("input.txt") as fp:
movements = []
for line in fp.readlines():
direction, amount = line.strip().split()
movements.append((direction, int(amount)))
... | MOVEMENTS = {
'forward': lambda x, y, a: (x + a, y),
'down': lambda x, y, a: (x, y - a),
'up': lambda x, y, a: (x, y + a),
}
with open("input.txt") as fp:
movements = []
for line in fp.readlines():
direction, amount = line.strip().split()
movements.append((direction, int(amount)))
... | none | 1 | 3.199081 | 3 | |
livemark/plugins/links/plugin.py | AyrtonB/livemark | 73 | 6632011 | <gh_stars>10-100
from copy import deepcopy
from ...plugin import Plugin
class LinksPlugin(Plugin):
identity = "links"
priority = 10
validity = {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": ... | from copy import deepcopy
from ...plugin import Plugin
class LinksPlugin(Plugin):
identity = "links"
priority = 10
validity = {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
... | en | 0.408743 | # Context # Process | 2.541228 | 3 |
neadva/Util.py | andrew-azarov/neadva | 0 | 6632012 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
import hmac
import binascii
import base64
import os
if os.name == "nt":
import _locale
_locale._gdl_bak = _locale._getdefaultlocale
_locale._getdefaultlocale = (lambda *args: (_locale._gdl_bak()[0], 'utf8'))
from typing import Union
from Crypto.Ci... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
import hmac
import binascii
import base64
import os
if os.name == "nt":
import _locale
_locale._gdl_bak = _locale._getdefaultlocale
_locale._getdefaultlocale = (lambda *args: (_locale._gdl_bak()[0], 'utf8'))
from typing import Union
from Crypto.Ci... | en | 0.801508 | #!/usr/bin/env python # -*- coding: utf-8 -*- #hashout = hmac.new(b'', b'', 'sha3_512') # A workaround because NAV uses PHP version of unsafe openssl based AES-128-ECB which is not directly compatible with raw AES | 2.590737 | 3 |
src/plot_spec.py | vitrioil/Speech-Separation | 55 | 6632013 | <filename>src/plot_spec.py
import sys
import librosa
import librosa.display
import numpy as np
import pandas as pd
from pathlib import Path
import matplotlib.pyplot as plt
from src import generate_audio
from src.models import Audio_Visual_Fusion as AVFusion
from src.loader import convert_to_spectrogram
def _plot(i,... | <filename>src/plot_spec.py
import sys
import librosa
import librosa.display
import numpy as np
import pandas as pd
from pathlib import Path
import matplotlib.pyplot as plt
from src import generate_audio
from src.models import Audio_Visual_Fusion as AVFusion
from src.loader import convert_to_spectrogram
def _plot(i,... | none | 1 | 2.541232 | 3 | |
homeassistant/components/vaillant/hub.py | pepsonEL/home-assistant | 0 | 6632014 | """Api hub and integration data."""
import logging
from pymultimatic.api import ApiError
from pymultimatic.model import (
Circulation,
HolidayMode,
HotWater,
OperatingModes,
QuickMode,
QuickModes,
QuickVeto,
Room,
System,
Zone,
ZoneCooling,
ZoneHeating,
)
import pymultim... | """Api hub and integration data."""
import logging
from pymultimatic.api import ApiError
from pymultimatic.model import (
Circulation,
HolidayMode,
HotWater,
OperatingModes,
QuickMode,
QuickModes,
QuickVeto,
Room,
System,
Zone,
ZoneCooling,
ZoneHeating,
)
import pymultim... | en | 0.806674 | Api hub and integration data. Check if provided username an password are corrects. Vaillant entry point for home-assistant. Initialize hub. Try to authenticate to the API. Request is not on the classic update since it won't fetch data. The request update will trigger something at vaillant API and it will ... | 2.041571 | 2 |
pyclustering/nnet/tests/unit/ut_som.py | JosephChataignon/pyclustering | 1,013 | 6632015 | """!
@brief Unit-tests for self-organized feature map.
@authors <NAME> (<EMAIL>)
@date 2014-2020
@copyright BSD-3-Clause
"""
import unittest
# Generate images without having a window appear.
import matplotlib
matplotlib.use('Agg')
from pyclustering.nnet.tests.som_templates import SomTestTemplate... | """!
@brief Unit-tests for self-organized feature map.
@authors <NAME> (<EMAIL>)
@date 2014-2020
@copyright BSD-3-Clause
"""
import unittest
# Generate images without having a window appear.
import matplotlib
matplotlib.use('Agg')
from pyclustering.nnet.tests.som_templates import SomTestTemplate... | en | 0.70592 | !
@brief Unit-tests for self-organized feature map.
@authors <NAME> (<EMAIL>)
@date 2014-2020
@copyright BSD-3-Clause # Generate images without having a window appear. | 2.369531 | 2 |
mnist/test_predict.py | rootpia/mnist_ai | 0 | 6632016 | <gh_stars>0
#!/usr/bin/env python
import argparse
import chainer
import numpy as np
from train_mnist import MLP
def print_predict(model):
# Load the MNIST dataset
_, test = chainer.datasets.get_mnist()
test, label = chainer.dataset.concat_examples(test)
pred = model(test)
pred = chainer.functio... | #!/usr/bin/env python
import argparse
import chainer
import numpy as np
from train_mnist import MLP
def print_predict(model):
# Load the MNIST dataset
_, test = chainer.datasets.get_mnist()
test, label = chainer.dataset.concat_examples(test)
pred = model(test)
pred = chainer.functions.softmax(p... | en | 0.214704 | #!/usr/bin/env python # Load the MNIST dataset # Load the MNIST dataset # load model # print_predict(model) | 2.851578 | 3 |
CIFAR10/models.py | ankanbansal/semi-supervised-learning | 0 | 6632017 | import numpy as np
# import ipdb
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import torch.nn.functional as F
import torchvision
import torchvision.models as tv_models
from torchvision import transforms
from densenet import densenet_cifar
class WSODModel(nn.Modu... | import numpy as np
# import ipdb
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import torch.nn.functional as F
import torchvision
import torchvision.models as tv_models
from torchvision import transforms
from densenet import densenet_cifar
class WSODModel(nn.Modu... | en | 0.851353 | # import ipdb The best performance is achieved by densenet_cifar model. Implementation has been obtained from: https://github.com/kuangliu/pytorch-cifar''' | 2.673766 | 3 |
fairseq-apr19/paraphrase-rescore-batch.py | ninikolov/low_resource_summarization | 3 | 6632018 | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
Trans... | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
Trans... | en | 0.765581 | #!/usr/bin/env python3 -u # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. Translate... | 2.360264 | 2 |
tests/conftest.py | audeering/audbackend | 0 | 6632019 | <gh_stars>0
import glob
import os
import shutil
import pytest
import audeer
import audfactory
pytest.ROOT = audeer.safe_path(
os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'tmp',
)
)
pytest.ARTIFACTORY_HOST = 'https://audeering.jfrog.io/artifactory'
pytest.FILE_SYSTEM_HOST = os... | import glob
import os
import shutil
import pytest
import audeer
import audfactory
pytest.ROOT = audeer.safe_path(
os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'tmp',
)
)
pytest.ARTIFACTORY_HOST = 'https://audeering.jfrog.io/artifactory'
pytest.FILE_SYSTEM_HOST = os.path.join(p... | none | 1 | 1.939166 | 2 | |
pyaib/components.py | loljoho-old/ainu | 0 | 6632020 | <reponame>loljoho-old/ainu
#!/usr/bin/env python
#
# Copyright 2013 Facebook
#
# 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... | #!/usr/bin/env python
#
# Copyright 2013 Facebook
#
# 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 agree... | en | 0.82181 | #!/usr/bin/env python # # Copyright 2013 Facebook # # 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 agree... | 2.059215 | 2 |
NestedList.py | shreya-n-kumari/python | 0 | 6632021 | employes = [['shreya',22,'developer'],['dekosta',25,'security'],['alina',30,'sales']]
print(employes) #print the all list.
for employe in employes:
print(employe) #print the sub lists.
for employee in employes:
print('Name:',(employee[0]))
print('Age: ', employee[1])
print('Department:',employee[... | employes = [['shreya',22,'developer'],['dekosta',25,'security'],['alina',30,'sales']]
print(employes) #print the all list.
for employe in employes:
print(employe) #print the sub lists.
for employee in employes:
print('Name:',(employee[0]))
print('Age: ', employee[1])
print('Department:',employee[... | en | 0.801863 | #print the all list. #print the sub lists. #print the list which is at index 1. | 4.202598 | 4 |
manage.py | willuvbb/test_fastapi_template | 128 | 6632022 | <reponame>willuvbb/test_fastapi_template
import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from application.initializer import IncludeAPIRouter
from application.main.config import settings
def get_application():
_app = FastAPI(title=settings.API_NAME,
... | import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from application.initializer import IncludeAPIRouter
from application.main.config import settings
def get_application():
_app = FastAPI(title=settings.API_NAME,
description=settings.API_DESCRIPTION,
... | en | 0.708345 | # on app shutdown do something probably close some connections or trigger some event #uvicorn.run("manage:app", host=settings.HOST, port=settings.PORT, log_level=settings.LOG_LEVEL, use_colors=True,reload=True) | 2.361539 | 2 |
venv/Lib/site-packages/pygame_gui/core/drawable_shapes/ellipse_drawable_shape.py | auneselva/pygame_shoot_out_zombies_ai | 0 | 6632023 | import math
from typing import Dict, List, Union, Tuple, Any
import pygame
from pygame_gui.core.interfaces import IUIManagerInterface
from pygame_gui.core.colour_gradient import ColourGradient
from pygame_gui.core.drawable_shapes.drawable_shape import DrawableShape
from pygame_gui.core.utility import apply_co... | import math
from typing import Dict, List, Union, Tuple, Any
import pygame
from pygame_gui.core.interfaces import IUIManagerInterface
from pygame_gui.core.colour_gradient import ColourGradient
from pygame_gui.core.drawable_shapes.drawable_shape import DrawableShape
from pygame_gui.core.utility import apply_co... | en | 0.880153 | A drawable ellipse shape for the UI, has theming options for a border, a shadow, colour
gradients and text.
:param containing_rect: The layout rectangle that surrounds and controls the size of this shape.
:param theming_parameters: Various styling parameters that control the final look of the shape.
... | 2.767134 | 3 |
exp_tools/Trial.py | StevenM1/flashtask | 0 | 6632024 | <reponame>StevenM1/flashtask<filename>exp_tools/Trial.py
#!/usr/bin/env python
# encoding: utf-8
"""
Session.py
Created by <NAME> on 2009-11-26.
Copyright (c) 2009 TK. All rights reserved.
"""
import time as time_module
from Session import *
class Trial(object):
"""base class for Trials"""
def __init__(se... | #!/usr/bin/env python
# encoding: utf-8
"""
Session.py
Created by <NAME> on 2009-11-26.
Copyright (c) 2009 TK. All rights reserved.
"""
import time as time_module
from Session import *
class Trial(object):
"""base class for Trials"""
def __init__(self, parameters={}, phase_durations=[], session=None, scre... | en | 0.820926 | #!/usr/bin/env python # encoding: utf-8 Session.py Created by <NAME> on 2009-11-26. Copyright (c) 2009 TK. All rights reserved. base class for Trials # pipe parameters to the eyelink data file in a for loop so as to limit the risk of flooding the buffer feedback give the subject feedback on performance draw function o... | 2.550564 | 3 |
test/datastore_test.py | truggles/pudl | 0 | 6632025 | """
Exercise the functionality in the datastore management module.
The local datastore is managed by a script that uses the datastore management
module to pull raw data from public sources, and organize it prior to ETL.
However, that process is time consuming because the data is large and far away.
Because of that, we... | """
Exercise the functionality in the datastore management module.
The local datastore is managed by a script that uses the datastore management
module to pull raw data from public sources, and organize it prior to ETL.
However, that process is time consuming because the data is large and far away.
Because of that, we... | en | 0.933022 | Exercise the functionality in the datastore management module. The local datastore is managed by a script that uses the datastore management module to pull raw data from public sources, and organize it prior to ETL. However, that process is time consuming because the data is large and far away. Because of that, we don... | 2.102029 | 2 |
project/server/plugins/double/double_negative.py | ibrezm1/minion-go | 0 | 6632026 | <filename>project/server/plugins/double/double_negative.py
from project.server import plugin_collection
class DoubleNegative(plugin_collection.Plugin):
"""This plugin will just multiply the argument with the value -2
"""
def __init__(self,input_data):
super().__init__(input_data)
self.descr... | <filename>project/server/plugins/double/double_negative.py
from project.server import plugin_collection
class DoubleNegative(plugin_collection.Plugin):
"""This plugin will just multiply the argument with the value -2
"""
def __init__(self,input_data):
super().__init__(input_data)
self.descr... | en | 0.709518 | This plugin will just multiply the argument with the value -2 The actual implementation of this plugin is to multiple the value of the supplied argument by -2 | 3.143284 | 3 |
Python/Export/export_mitral.py | OpenSourceBrain/MiglioreEtAl14_OlfactoryBulb3D | 1 | 6632027 | <reponame>OpenSourceBrain/MiglioreEtAl14_OlfactoryBulb3D
import os
import sys
import neuroml
import exportHelper
#Nav to neuron folder where compiled MOD files are present
os.chdir("../../NEURON")
from neuron import h
os.chdir("../NeuroML2")
h.chdir('../NEURON')
h.load_file('mitral.hoc')
sys.path.append('../NEURON')
... | import os
import sys
import neuroml
import exportHelper
#Nav to neuron folder where compiled MOD files are present
os.chdir("../../NEURON")
from neuron import h
os.chdir("../NeuroML2")
h.chdir('../NEURON')
h.load_file('mitral.hoc')
sys.path.append('../NEURON')
from mkmitral import mkmitral
from pyneuroml.neuron impo... | en | 0.711576 | #Nav to neuron folder where compiled MOD files are present # Ensure hillock parent is soma # Fix initial and hillock segs by moving them to the soma # Set root to id=0 and increment others # TODO: cell.position(x,y,z) used for cell positioning in networks does not work as expected # See: https://github.com/NeuroML/jNeu... | 2.401799 | 2 |
src/hed_utils/cli/csv_search.py | Hrissimir/hed_utils | 0 | 6632028 | """usage: csv-search [-h]
[-v] [-vv] [--log-format LOG_FORMAT]
[-d DIRECTORY] [-o TEXT_REPORT] [-xl EXCEL_REPORT]
[-e ENCODING] -t TEXT [-i]
Find text in CSV files.
optional arguments:
-h, --help show this help message and exit
-d ... | """usage: csv-search [-h]
[-v] [-vv] [--log-format LOG_FORMAT]
[-d DIRECTORY] [-o TEXT_REPORT] [-xl EXCEL_REPORT]
[-e ENCODING] -t TEXT [-i]
Find text in CSV files.
optional arguments:
-h, --help show this help message and exit
-d ... | en | 0.401495 | usage: csv-search [-h] [-v] [-vv] [--log-format LOG_FORMAT] [-d DIRECTORY] [-o TEXT_REPORT] [-xl EXCEL_REPORT] [-e ENCODING] -t TEXT [-i] Find text in CSV files. optional arguments: -h, --help show this help message and exit -d DIR... | 2.891757 | 3 |
tools/download-wheels.py | Ennosigaeon/scipy | 1 | 6632029 | <reponame>Ennosigaeon/scipy
#!/usr/bin/env python
"""
Download SciPy wheels from Anaconda staging area.
"""
import sys
import os
import re
import shutil
import argparse
import urllib3
from bs4 import BeautifulSoup
__version__ = '0.1'
# Edit these for other projects.
STAGING_URL = 'https://anaconda.org/multibuild-wh... | #!/usr/bin/env python
"""
Download SciPy wheels from Anaconda staging area.
"""
import sys
import os
import re
import shutil
import argparse
import urllib3
from bs4 import BeautifulSoup
__version__ = '0.1'
# Edit these for other projects.
STAGING_URL = 'https://anaconda.org/multibuild-wheels-staging/scipy'
PREFIX =... | en | 0.781673 | #!/usr/bin/env python Download SciPy wheels from Anaconda staging area. # Edit these for other projects. Get wheel names from Anaconda HTML directory. This looks in the Anaconda multibuild-wheels-staging page and parses the HTML to get all the wheel names for a release version. Parameters ---------- ... | 2.947379 | 3 |
companies/migrations/0001_initial.py | maxinsar/insar | 0 | 6632030 | <reponame>maxinsar/insar
# Generated by Django 2.2.5 on 2019-09-16 17:05
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_US... | # Generated by Django 2.2.5 on 2019-09-16 17:05
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | en | 0.738622 | # Generated by Django 2.2.5 on 2019-09-16 17:05 | 1.738039 | 2 |
math/uva10107 what is the median.py | windowssocket/py_leetcode | 3 | 6632031 | <filename>math/uva10107 what is the median.py
import sys
import bisect
numList = []
for line in sys.stdin:
# pos = bisect.bisect(numList,int(line))
bisect.insort(numList,int(line))
pos = len(numList) // 2
if len(numList) % 2 == 0:
print((numList[pos] + numList[pos-1]) // 2)
else:
pri... | <filename>math/uva10107 what is the median.py
import sys
import bisect
numList = []
for line in sys.stdin:
# pos = bisect.bisect(numList,int(line))
bisect.insort(numList,int(line))
pos = len(numList) // 2
if len(numList) % 2 == 0:
print((numList[pos] + numList[pos-1]) // 2)
else:
pri... | en | 0.496991 | # pos = bisect.bisect(numList,int(line)) | 3.390651 | 3 |
raiden_contracts/utils/sign.py | hackaugusto/raiden-contracts | 0 | 6632032 | from web3 import Web3
from .sign_utils import sign
def hash_balance_data(transferred_amount, locked_amount, locksroot):
return Web3.soliditySha3(
['uint256', 'uint256', 'bytes32'],
[transferred_amount, locked_amount, locksroot],
)
def hash_balance_proof(
token_network_address,
... | from web3 import Web3
from .sign_utils import sign
def hash_balance_data(transferred_amount, locked_amount, locksroot):
return Web3.soliditySha3(
['uint256', 'uint256', 'bytes32'],
[transferred_amount, locked_amount, locksroot],
)
def hash_balance_proof(
token_network_address,
... | none | 1 | 2.052083 | 2 | |
tests/api/test_cors.py | dioptra-io/iris | 6 | 6632033 | <filename>tests/api/test_cors.py
import pytest
@pytest.mark.parametrize("origin", ["https://example.org", "http://localhost:8000"])
def test_cors_allowed_origin(make_client, make_user, origin):
# https://fastapi.tiangolo.com/advanced/testing-events/?h=startup
# https://github.com/encode/starlette/blob/master/... | <filename>tests/api/test_cors.py
import pytest
@pytest.mark.parametrize("origin", ["https://example.org", "http://localhost:8000"])
def test_cors_allowed_origin(make_client, make_user, origin):
# https://fastapi.tiangolo.com/advanced/testing-events/?h=startup
# https://github.com/encode/starlette/blob/master/... | en | 0.45152 | # https://fastapi.tiangolo.com/advanced/testing-events/?h=startup # https://github.com/encode/starlette/blob/master/tests/middleware/test_cors.py | 2.165366 | 2 |
apps/core/account/manager.py | GMNaim/Online-Exam-System | 0 | 6632034 | from django.contrib.auth.base_user import BaseUserManager
from django.utils.translation import ugettext_lazy as _
# ugettext is a unicode version of a translatable string.
# ugettext_lazy is a "lazy" version of that. Lazy strings are
# a Django-ism; they are string-like objects that don't
# actually turn into the rea... | from django.contrib.auth.base_user import BaseUserManager
from django.utils.translation import ugettext_lazy as _
# ugettext is a unicode version of a translatable string.
# ugettext_lazy is a "lazy" version of that. Lazy strings are
# a Django-ism; they are string-like objects that don't
# actually turn into the rea... | en | 0.923239 | # ugettext is a unicode version of a translatable string. # ugettext_lazy is a "lazy" version of that. Lazy strings are # a Django-ism; they are string-like objects that don't # actually turn into the real string until the last possible minute. # Often, you can't know how to translate a string until late in the process... | 2.403537 | 2 |
tests/components/devolo_home_control/test_init.py | tbarbette/core | 4 | 6632035 | <gh_stars>1-10
"""Tests for the devolo Home Control integration."""
from unittest.mock import patch
from devolo_home_control_api.exceptions.gateway import GatewayOfflineError
import pytest
from homeassistant.config_entries import (
ENTRY_STATE_LOADED,
ENTRY_STATE_NOT_LOADED,
ENTRY_STATE_SETUP_ERROR,
E... | """Tests for the devolo Home Control integration."""
from unittest.mock import patch
from devolo_home_control_api.exceptions.gateway import GatewayOfflineError
import pytest
from homeassistant.config_entries import (
ENTRY_STATE_LOADED,
ENTRY_STATE_NOT_LOADED,
ENTRY_STATE_SETUP_ERROR,
ENTRY_STATE_SETU... | en | 0.764865 | Tests for the devolo Home Control integration. Test setup entry. Test setup entry fails if credentials are invalid. Test setup entry fails if mydevolo is in maintenance mode. Test setup entry fails on connection error. Test setup entry fails on gateway offline. Test unload entry. | 2.021052 | 2 |
src/ExportCsvToInflux/csv_object.py | kganczarek-adultimagroup/dpp-elc-export-csv-to-influx | 31 | 6632036 | <filename>src/ExportCsvToInflux/csv_object.py
from collections import defaultdict
from .base_object import BaseObject
from itertools import tee
from glob import glob
import hashlib
import types
import time
import json
import csv
import sys
import os
class CSVObject(object):
"""CSV Object"""
def __init__(self... | <filename>src/ExportCsvToInflux/csv_object.py
from collections import defaultdict
from .base_object import BaseObject
from itertools import tee
from glob import glob
import hashlib
import types
import time
import json
import csv
import sys
import os
class CSVObject(object):
"""CSV Object"""
def __init__(self... | en | 0.459422 | CSV Object Function: get_csv_header. :param file_name: the file name :return return csv header as list Function: search_files_in_dir :param directory: the directory :param match_suffix: match the file suffix, use comma to separate, only string, not support regex :param filter_p... | 3.080251 | 3 |
backend/uclapi/dashboard/migrations/0001_initial.py | balping/uclapi | 0 | 6632037 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-13 14:58
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-13 14:58
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | en | 0.750156 | # -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-13 14:58 | 1.688613 | 2 |
xmodaler/modeling/meta_arch/__init__.py | cclauss/xmodaler | 830 | 6632038 | # -*- coding: utf-8 -*-
"""
From original at https://github.com/facebookresearch/detectron2/blob/master/detectron2/modeling/meta_arch/__init__.py
Original copyright of Facebook code below, modifications by <NAME>, Copyright 2021.
"""
# Copyright (c) Facebook, Inc. and its affiliates.
from .build import META_ARCH_REGI... | # -*- coding: utf-8 -*-
"""
From original at https://github.com/facebookresearch/detectron2/blob/master/detectron2/modeling/meta_arch/__init__.py
Original copyright of Facebook code below, modifications by <NAME>, Copyright 2021.
"""
# Copyright (c) Facebook, Inc. and its affiliates.
from .build import META_ARCH_REGI... | en | 0.743874 | # -*- coding: utf-8 -*- From original at https://github.com/facebookresearch/detectron2/blob/master/detectron2/modeling/meta_arch/__init__.py Original copyright of Facebook code below, modifications by <NAME>, Copyright 2021. # Copyright (c) Facebook, Inc. and its affiliates. | 1.184496 | 1 |
demo/socket_send.py | konflic/python_qa_socket | 0 | 6632039 | import socket
from demo.config import LOCALHOST
# Define this target port
TARGET_PORT = None
my_socket = socket.socket()
address_and_port = (LOCALHOST, TARGET_PORT)
my_socket.connect(address_and_port)
# https://docs.python.org/3/library/socket.html#socket.socket.send
data_amount = my_socket.send(b"Hello, socket!")... | import socket
from demo.config import LOCALHOST
# Define this target port
TARGET_PORT = None
my_socket = socket.socket()
address_and_port = (LOCALHOST, TARGET_PORT)
my_socket.connect(address_and_port)
# https://docs.python.org/3/library/socket.html#socket.socket.send
data_amount = my_socket.send(b"Hello, socket!")... | en | 0.559227 | # Define this target port # https://docs.python.org/3/library/socket.html#socket.socket.send | 3.263992 | 3 |
crslab/config/config.py | Xiaolong-Qi/CRSLab | 1 | 6632040 | # @Time : 2020/11/22
# @Author : <NAME>
# @Email : <EMAIL>
# UPDATE:
# @Time : 2020/11/23, 2020/12/20
# @Author : <NAME>, <NAME>
# @Email : <EMAIL>, <EMAIL>
import json
import os
import time
from pprint import pprint
import yaml
from loguru import logger
from tqdm import tqdm
class Config:
"""Configurato... | # @Time : 2020/11/22
# @Author : <NAME>
# @Email : <EMAIL>
# UPDATE:
# @Time : 2020/11/23, 2020/12/20
# @Author : <NAME>, <NAME>
# @Email : <EMAIL>, <EMAIL>
import json
import os
import time
from pprint import pprint
import yaml
from loguru import logger
from tqdm import tqdm
class Config:
"""Configurato... | en | 0.536933 | # @Time : 2020/11/22 # @Author : <NAME> # @Email : <EMAIL> # UPDATE: # @Time : 2020/11/23, 2020/12/20 # @Author : <NAME>, <NAME> # @Email : <EMAIL>, <EMAIL> Configurator module that load the defined parameters. Load parameters and set log level. Args: config_file (str): path to the config fil... | 2.126657 | 2 |
script/Other/client.py | StevenDias33/InfoSecNotes | 0 | 6632041 | import socket # Import socket module
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 60000 # Reserve a port for your service.
s.connect((host, port))
s.send("Hello server!")
with open('received_file', 'wb') ... | import socket # Import socket module
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 60000 # Reserve a port for your service.
s.connect((host, port))
s.send("Hello server!")
with open('received_file', 'wb') ... | en | 0.641348 | # Import socket module # Create a socket object # Get local machine name # Reserve a port for your service. # write data to a file | 3.138886 | 3 |
tools/mircounts/format_fasta_hairpins.py | moskalenko/tools-artbio | 0 | 6632042 | import argparse
import gzip
def Parser():
the_parser = argparse.ArgumentParser()
the_parser.add_argument(
'--hairpins_path', action="store", type=str,
help="BASE url. ex: /pub/mirbase/22/")
the_parser.add_argument(
'--output', action="store", type=str,
help="parsed hairpin ... | import argparse
import gzip
def Parser():
the_parser = argparse.ArgumentParser()
the_parser.add_argument(
'--hairpins_path', action="store", type=str,
help="BASE url. ex: /pub/mirbase/22/")
the_parser.add_argument(
'--output', action="store", type=str,
help="parsed hairpin ... | en | 0.495873 | gzipfile value example : 'mirbase/22/hairpin.fa.gz' # dump the sequence of the previous item # take first word of item ''' # for the last item | 3.390483 | 3 |
walky/registry.py | tallynerdy/walky | 0 | 6632043 | <reponame>tallynerdy/walky<gh_stars>0
import os
import base64
import json
import weakref
from walky.constants import *
from walky.objects import *
from walky.objects.system import *
from walky.serializer import *
def reg_object_id(obj):
""" Returns the registry encoded version of an object's id
Uses walk... | import os
import base64
import json
import weakref
from walky.constants import *
from walky.objects import *
from walky.objects.system import *
from walky.serializer import *
def reg_object_id(obj):
""" Returns the registry encoded version of an object's id
Uses walky.objects.common.object_id so it will d... | en | 0.800342 | Returns the registry encoded version of an object's id Uses walky.objects.common.object_id so it will dig down to the underlying object's id if required. This should contain information required at the connection level to allow it to operate independantly Register an object. If reg_obj_id is pr... | 2.495841 | 2 |
pytorch_lightning/accelerators/cpu_backend.py | dkmiller/pytorch-lightning | 1 | 6632044 | <gh_stars>1-10
# Copyright The PyTorch Lightning team.
#
# 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... | # Copyright The PyTorch Lightning team.
#
# 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 i... | en | 0.875264 | # Copyright The PyTorch Lightning team. # # 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 i... | 2.105603 | 2 |
tests/modules/children/grandchildren/foo.py | Fryguy/py2rb | 124 | 6632045 | def hi():
print("Hi! I'm foo.")
| def hi():
print("Hi! I'm foo.")
| none | 1 | 1.673675 | 2 | |
tests/__init__.py | jokaorgua/trendet | 272 | 6632046 | <reponame>jokaorgua/trendet
# Copyright 2019-2020 <NAME>
# See LICENSE for details. | # Copyright 2019-2020 <NAME>
# See LICENSE for details. | en | 0.643656 | # Copyright 2019-2020 <NAME> # See LICENSE for details. | 0.806579 | 1 |
exec_vig.py | aliasgar1978/pyVig | 0 | 6632047 | <filename>exec_vig.py
from pyVig.visio import device, VisioObject
from pyVig.static import op_file
from pyVig.stencils import *
from pyVig.database import DeviceData, CableMatrixData
# # -----------------------------------------------------------------------------------
# data_file = 'data.xlsx'
# data_file = '... | <filename>exec_vig.py
from pyVig.visio import device, VisioObject
from pyVig.static import op_file
from pyVig.stencils import *
from pyVig.database import DeviceData, CableMatrixData
# # -----------------------------------------------------------------------------------
# data_file = 'data.xlsx'
# data_file = '... | en | 0.332931 | # # ----------------------------------------------------------------------------------- # data_file = 'data.xlsx' # data_file = 'data - vod.xlsx' # # # ----------------------------------------------------------------------------------- # drop device # description of device # connect these two devices # # # ------------... | 2.352254 | 2 |
connector-packager/connector_packager/jar_jdk_packager.py | LevyForchh/connector-plugin-sdk | 0 | 6632048 | import os
import logging
import subprocess
import shutil
import xml.etree.ElementTree as ET
from pathlib import Path
from typing import List
from .connector_file import ConnectorFile
from .helper import check_jdk_environ_variable
from .version import __min_version_tableau__
JAR_EXECUTABLE_NAME = "jar"
if os.name == ... | import os
import logging
import subprocess
import shutil
import xml.etree.ElementTree as ET
from pathlib import Path
from typing import List
from .connector_file import ConnectorFile
from .helper import check_jdk_environ_variable
from .version import __min_version_tableau__
JAR_EXECUTABLE_NAME = "jar"
if os.name == ... | en | 0.703752 | Stamp of minimum support version to the connector manifest in packaged jar file :param input_dir: source dir of files to be packaged :type input_dir: Path :param file_list: files need to be packaged :type file_list: list of ConnectorFile :param jar_filename: filename of the created JAR :type ... | 2.372282 | 2 |
aws_quota/check/rds.py | yanbinren/aws-quota-checker | 0 | 6632049 | from .quota_check import QuotaCheck, QuotaScope
class RDSDBInstanceCountCheck(QuotaCheck):
key = "rds_instances"
description = "RDS instances per region"
service_code = "rds"
scope = QuotaScope.REGION
quota_code = "L-7B6409FD"
@property
def current(self) -> int:
return self.count_p... | from .quota_check import QuotaCheck, QuotaScope
class RDSDBInstanceCountCheck(QuotaCheck):
key = "rds_instances"
description = "RDS instances per region"
service_code = "rds"
scope = QuotaScope.REGION
quota_code = "L-7B6409FD"
@property
def current(self) -> int:
return self.count_p... | none | 1 | 2.218845 | 2 | |
label_studio/io_storages/functions.py | pachyderm/label-studio | 0 | 6632050 | from .s3.api import S3ImportStorageListAPI, S3ExportStorageListAPI
from .gcs.api import GCSImportStorageListAPI, GCSExportStorageListAPI
from .azure_blob.api import AzureBlobImportStorageListAPI, AzureBlobExportStorageListAPI
from .redis.api import RedisImportStorageListAPI, RedisExportStorageListAPI
from .pachyderm.ap... | from .s3.api import S3ImportStorageListAPI, S3ExportStorageListAPI
from .gcs.api import GCSImportStorageListAPI, GCSExportStorageListAPI
from .azure_blob.api import AzureBlobImportStorageListAPI, AzureBlobExportStorageListAPI
from .redis.api import RedisImportStorageListAPI, RedisExportStorageListAPI
from .pachyderm.ap... | none | 1 | 1.64356 | 2 |