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
CTFd/plugins/dynamic_challenges/__init__.py
MarkSablan/CTFd
8
6627051
<gh_stars>1-10 from __future__ import division # Use floating point for math calculations import math from flask import Blueprint from CTFd.models import Challenges, Solves, db from CTFd.plugins import register_plugin_assets_directory from CTFd.plugins.challenges import CHALLENGE_CLASSES, BaseChallenge from CTFd.pl...
from __future__ import division # Use floating point for math calculations import math from flask import Blueprint from CTFd.models import Challenges, Solves, db from CTFd.plugins import register_plugin_assets_directory from CTFd.plugins.challenges import CHALLENGE_CLASSES, BaseChallenge from CTFd.plugins.migration...
en
0.856703
# Use floating point for math calculations # Unique identifier used to register challenges # Name of a challenge type # Handlebars templates used for each aspect of challenge editing & viewing # Scripts that are loaded when a template is loaded # Route at which files are accessible. This must be registered using regist...
2.208903
2
tests/user_test.py
eLemmings/back
0
6627052
<filename>tests/user_test.py ''' Moduł do testów Wykonuje podane zapytania do API i generuje plik html z ich rezultatami ''' import requests import json import os from datetime import datetime from jinja2 import Environment, FileSystemLoader env = Environment(loader=FileSystemLoader('tests')) template = env.get_t...
<filename>tests/user_test.py ''' Moduł do testów Wykonuje podane zapytania do API i generuje plik html z ich rezultatami ''' import requests import json import os from datetime import datetime from jinja2 import Environment, FileSystemLoader env = Environment(loader=FileSystemLoader('tests')) template = env.get_t...
pl
0.924692
Moduł do testów Wykonuje podane zapytania do API i generuje plik html z ich rezultatami
2.727388
3
tests/unit/express/facade_tests.py
st8st8/django-oscar-paypal
0
6627053
<reponame>st8st8/django-oscar-paypal<gh_stars>0 from decimal import Decimal as D from unittest import TestCase from unittest.mock import Mock, patch from urllib.parse import parse_qs import pytest from oscar.apps.shipping.methods import Free from purl import URL from paypal.express.facade import fetch_transaction_det...
from decimal import Decimal as D from unittest import TestCase from unittest.mock import Mock, patch from urllib.parse import parse_qs import pytest from oscar.apps.shipping.methods import Free from purl import URL from paypal.express.facade import fetch_transaction_details, get_paypal_url from paypal.models import E...
it
0.097741
# defaults # noqa E501
2.323642
2
fdep/commands/upload.py
checkr/fdep
9
6627054
"""Upload a file to the designated storage backend. .. code:: bash fdep upload <files...> .. note:: Note that just doing ``fdep upload`` doesn't work. You have to specify the file names. We omitted that out in order to emphasize uploading, since it can be destructive. """ import os import sys import time from thr...
"""Upload a file to the designated storage backend. .. code:: bash fdep upload <files...> .. note:: Note that just doing ``fdep upload`` doesn't work. You have to specify the file names. We omitted that out in order to emphasize uploading, since it can be destructive. """ import os import sys import time from thr...
en
0.941442
Upload a file to the designated storage backend. .. code:: bash fdep upload <files...> .. note:: Note that just doing ``fdep upload`` doesn't work. You have to specify the file names. We omitted that out in order to emphasize uploading, since it can be destructive. Handle upload commands. # Clean up the wrong one...
2.561269
3
tests/st/scipy_st/test_linalg.py
Ascend/mindspore
5
6627055
# Copyright 2021 Huawei Technologies Co., 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...
# Copyright 2021 Huawei Technologies Co., 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...
en
0.773859
# Copyright 2021 Huawei Technologies Co., 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...
2.010533
2
build/apply_locales.py
knopp/buildroot
2,151
6627056
<gh_stars>1000+ #!/usr/bin/env python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # TODO: remove this script when GYP has for loops import sys import optparse def main(argv): parser = optparse...
#!/usr/bin/env python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # TODO: remove this script when GYP has for loops import sys import optparse def main(argv): parser = optparse.OptionParser() ...
en
0.860432
#!/usr/bin/env python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # TODO: remove this script when GYP has for loops # For Cocoa to find the locale at runtime, it needs to use '_' instead # of '-' (h...
2.305208
2
users/views.py
hahaxhhsz/fadiandian
0
6627057
# Create your views here. from users.models import Users from users.serializers import UsersSerializer from django.http import Http404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status import json # 获取所有用户信息 class getAllUsers(APIView): def ge...
# Create your views here. from users.models import Users from users.serializers import UsersSerializer from django.http import Http404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status import json # 获取所有用户信息 class getAllUsers(APIView): def ge...
zh
0.727815
# Create your views here. # 获取所有用户信息 # 注册 # 登陆,若已登陆的账号无法实现再次登陆 # 登出 # 获取单个用户信息
2.473277
2
beginner_source/basics/optimization_tutorial.py
Lezcano/tutorials
1
6627058
""" `Learn the Basics <intro.html>`_ || `Quickstart <quickstart_tutorial.html>`_ || `Tensors <tensorqs_tutorial.html>`_ || `Datasets & DataLoaders <data_tutorial.html>`_ || `Transforms <transforms_tutorial.html>`_ || `Build Model <buildmodel_tutorial.html>`_ || `Autograd <autogradqs_tutorial.html>`_ || **Optimization...
""" `Learn the Basics <intro.html>`_ || `Quickstart <quickstart_tutorial.html>`_ || `Tensors <tensorqs_tutorial.html>`_ || `Datasets & DataLoaders <data_tutorial.html>`_ || `Transforms <transforms_tutorial.html>`_ || `Build Model <buildmodel_tutorial.html>`_ || `Autograd <autogradqs_tutorial.html>`_ || **Optimization...
en
0.706274
`Learn the Basics <intro.html>`_ || `Quickstart <quickstart_tutorial.html>`_ || `Tensors <tensorqs_tutorial.html>`_ || `Datasets & DataLoaders <data_tutorial.html>`_ || `Transforms <transforms_tutorial.html>`_ || `Build Model <buildmodel_tutorial.html>`_ || `Autograd <autogradqs_tutorial.html>`_ || **Optimization** |...
4.023796
4
mp_calc/app/serverlibrary.py
shanghongsim/d2w
0
6627059
<gh_stars>0 def mergesort(array, byfunc=None): p=0 r=len(array)-1 mergesort_recursive(array, p, r, byfunc) return array def merge(array, p, q, r, byfunc): nleft=q-p+1 nright=r-q left_array=array[p:q+1] right_array=array[q+1:r+1] left=0 right=0 dest=p if byfunc!=None: ...
def mergesort(array, byfunc=None): p=0 r=len(array)-1 mergesort_recursive(array, p, r, byfunc) return array def merge(array, p, q, r, byfunc): nleft=q-p+1 nright=r-q left_array=array[p:q+1] right_array=array[q+1:r+1] left=0 right=0 dest=p if byfunc!=None: while (...
en
0.73746
# print(operand_stack.peek()) # print(operator_stack.peek()) # print("----")
3.790642
4
YouTube-Video-Downloader/YouTube-video-downloader-2.py
vusalaxndzde/YouTube-video-downloader-youtube_dl
2
6627060
<reponame>vusalaxndzde/YouTube-video-downloader-youtube_dl import youtube_dl from pytube import YouTube from PyQt5 import QtWidgets, QtGui import sys class Window(QtWidgets.QWidget): def __init__(self): super().__init__() self.setWindowTitle("YouTube Video Downloader") self.setMaximumSize(6...
import youtube_dl from pytube import YouTube from PyQt5 import QtWidgets, QtGui import sys class Window(QtWidgets.QWidget): def __init__(self): super().__init__() self.setWindowTitle("YouTube Video Downloader") self.setMaximumSize(670, 330) self.setMinimumSize(670, 330) self...
none
1
2.737255
3
output/models/ms_data/datatypes/facets/nmtokens/nmtokens_pattern001_xsd/nmtokens_pattern001.py
tefra/xsdata-w3c-tests
1
6627061
from dataclasses import dataclass, field from typing import List @dataclass class Foo: class Meta: name = "foo" value: List[str] = field( default_factory=list, metadata={ "required": True, "pattern": r"[A-C]{0,2}", "tokens": True, } )
from dataclasses import dataclass, field from typing import List @dataclass class Foo: class Meta: name = "foo" value: List[str] = field( default_factory=list, metadata={ "required": True, "pattern": r"[A-C]{0,2}", "tokens": True, } )
none
1
2.950213
3
test/unit/test_api_users.py
ldn-softdev/pyeapi
126
6627062
<reponame>ldn-softdev/pyeapi # # Copyright (c) 2015, Arista Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # Redistributions of source code must retain the above copyright no...
# # Copyright (c) 2015, Arista Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # Redistributions of source code must retain the above copyright notice, # this list of condit...
en
0.732862
# # Copyright (c) 2015, Arista Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # Redistributions of source code must retain the above copyright notice, # this list of condit...
1.371219
1
gw/work/S190425z-KMTNet-split_phot.py
SilverRon/gppy
4
6627063
<gh_stars>1-10 # PHOTOMETRY CODE FOR PYTHON 3.X # 2019.06.20 CREATED BY <NAME> # 2019.10.06 MODIFIED BY <NAME> #============================================================ import os, glob import numpy as np import matplotlib.pyplot as plt from astropy.table import Table, vstack from astropy.io import ascii from astrop...
# PHOTOMETRY CODE FOR PYTHON 3.X # 2019.06.20 CREATED BY <NAME> # 2019.10.06 MODIFIED BY <NAME> #============================================================ import os, glob import numpy as np import matplotlib.pyplot as plt from astropy.table import Table, vstack from astropy.io import ascii from astropy.io import fit...
en
0.116911
# PHOTOMETRY CODE FOR PYTHON 3.X # 2019.06.20 CREATED BY <NAME> # 2019.10.06 MODIFIED BY <NAME> #============================================================ #============================================================ # FUNCTION #============================================================ #--------------------------...
2.360709
2
kvlog/__init__.py
magicray/keyvaluestore
0
6627064
<filename>kvlog/__init__.py<gh_stars>0 import json import urllib.parse import urllib.request class Client(): def __init__(self, servers): self.servers = servers self.leader = None def server_list(self): servers = [self.leader] if self.leader else [] servers.extend(self.servers...
<filename>kvlog/__init__.py<gh_stars>0 import json import urllib.parse import urllib.request class Client(): def __init__(self, servers): self.servers = servers self.leader = None def server_list(self): servers = [self.leader] if self.leader else [] servers.extend(self.servers...
none
1
2.742887
3
main.py
TeKraft/OwlNightLong
0
6627065
from preprocessing import * from processingData import * from postprocessing import * from saveMap import * import os # dataPath = os.path.join('C:\\','Users','s_slim01','Downloads','movebank','movebank','eagle_owl','Eagle owl Reinhard Vohwinkel MPIO','points.shp') #dataPath = os.path.join('/home','torben','D...
from preprocessing import * from processingData import * from postprocessing import * from saveMap import * import os # dataPath = os.path.join('C:\\','Users','s_slim01','Downloads','movebank','movebank','eagle_owl','Eagle owl Reinhard Vohwinkel MPIO','points.shp') #dataPath = os.path.join('/home','torben','D...
en
0.353913
# dataPath = os.path.join('C:\\','Users','s_slim01','Downloads','movebank','movebank','eagle_owl','Eagle owl Reinhard Vohwinkel MPIO','points.shp') #dataPath = os.path.join('/home','torben','Documents','uni','Master','SS_2018','PyGIS','final_submission','movebank','eagle_owl','Eagle owl Reinhard Vohwinkel MPIO','points...
2.111828
2
vqgan/config.py
davisyoshida/vqgan-haiku
0
6627066
<filename>vqgan/config.py from collections import namedtuple import haiku as hk VQGanConfig = namedtuple('VQGanConfig', [ 'learning_rate', 'resolution', 'no_downscale_layers', 'embed_dim', 'n_embed', 'ch_mult', 'num_res_blocks', 'channels', 'temb_channels', 'dropout', 'z_ch...
<filename>vqgan/config.py from collections import namedtuple import haiku as hk VQGanConfig = namedtuple('VQGanConfig', [ 'learning_rate', 'resolution', 'no_downscale_layers', 'embed_dim', 'n_embed', 'ch_mult', 'num_res_blocks', 'channels', 'temb_channels', 'dropout', 'z_ch...
none
1
2.016654
2
tensorflow_datasets/summarization/samsum.py
ChAnYaNG97/datasets
1
6627067
<filename>tensorflow_datasets/summarization/samsum.py<gh_stars>1-10 # coding=utf-8 # Copyright 2020 The TensorFlow Datasets 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 # # ht...
<filename>tensorflow_datasets/summarization/samsum.py<gh_stars>1-10 # coding=utf-8 # Copyright 2020 The TensorFlow Datasets 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 # # ht...
en
0.737646
# coding=utf-8 # Copyright 2020 The TensorFlow Datasets 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 appl...
1.942754
2
tests/explainers/test_linear.py
NunoEdgarGFlowHub/shap
1
6627068
<reponame>NunoEdgarGFlowHub/shap<filename>tests/explainers/test_linear.py import matplotlib import numpy as np matplotlib.use('Agg') import shap def test_tied_pair(): np.random.seed(0) beta = np.array([1, 0, 0]) mu = np.zeros(3) Sigma = np.array([[1, 0.999999, 0], [0.999999, 1, 0], [0, 0, 1]]) X ...
import matplotlib import numpy as np matplotlib.use('Agg') import shap def test_tied_pair(): np.random.seed(0) beta = np.array([1, 0, 0]) mu = np.zeros(3) Sigma = np.array([[1, 0.999999, 0], [0.999999, 1, 0], [0, 0, 1]]) X = np.ones((1,3)) explainer = shap.LinearExplainer((beta, 0), (mu, Sigm...
en
0.627322
# train linear model # explain the model's predictions using SHAP values # test duplicated features # test multiple colinear features # test null features # generate linear data # train linear model # explain the model's predictions using SHAP values Make sure things work with a univariate linear regression. # generate...
2.79897
3
support/retro_contest/agent.py
hermesdt/retro-contest
51
6627069
import argparse import gym_remote.exceptions as gre import gym_remote.client as grc import os import sys import traceback from pkg_resources import EntryPoint def make(socketdir='tmp/sock'): env = grc.RemoteEnv(socketdir) return env def run(agent=None, socketdir='tmp/sock', daemonize=False, args=[]): if...
import argparse import gym_remote.exceptions as gre import gym_remote.client as grc import os import sys import traceback from pkg_resources import EntryPoint def make(socketdir='tmp/sock'): env = grc.RemoteEnv(socketdir) return env def run(agent=None, socketdir='tmp/sock', daemonize=False, args=[]): if...
none
1
2.091244
2
gpuexperiments/occupancy_dyn.py
hughperkins/gpu-experiments
2
6627070
<filename>gpuexperiments/occupancy_dyn.py """ Try using dynamic shared memory, see if gets optimized away, or affects occupancy """ from __future__ import print_function, division import os from os.path import join import time import string import jinja2 import numpy as np import pyopencl as cl import subprocess from g...
<filename>gpuexperiments/occupancy_dyn.py """ Try using dynamic shared memory, see if gets optimized away, or affects occupancy """ from __future__ import print_function, division import os from os.path import join import time import string import jinja2 import numpy as np import pyopencl as cl import subprocess from g...
en
0.465757
Try using dynamic shared memory, see if gets optimized away, or affects occupancy kernel void {{name}} (global float *data, global float *out{% if shared %}, local float *F{% endif %}) { {% for j in range(ilp) %} float a{{j}} = data[{{j}}]; {% endfor %} ...
1.766144
2
python/DL_for_HTT/common/model_inputs/GENleg_with_METcov_j1j2jr_Nnu_Npu.py
lucastorterotot/DL_for_HTT_mass
1
6627071
inputs = [ "leg1_pt_gen", "leg1_eta_gen", "leg1_phi_gen", "leg2_pt_gen", "leg2_eta_gen", "leg2_phi_gen", "jet1_pt_reco", "jet1_eta_reco", "jet1_phi_reco", "jet2_pt_reco", "jet2_eta_reco", "jet2_phi_reco", "remaining_jets_pt_reco", "remaining_jets_eta_reco", "r...
inputs = [ "leg1_pt_gen", "leg1_eta_gen", "leg1_phi_gen", "leg2_pt_gen", "leg2_eta_gen", "leg2_phi_gen", "jet1_pt_reco", "jet1_eta_reco", "jet1_phi_reco", "jet2_pt_reco", "jet2_eta_reco", "jet2_phi_reco", "remaining_jets_pt_reco", "remaining_jets_eta_reco", "r...
en
0.349516
# "MET_significance_reco",
1.209551
1
accounts/models.py
joshgoshbgosh/ccs-final-project
1
6627072
<reponame>joshgoshbgosh/ccs-final-project from django.db import models from django.conf import settings from django.contrib.auth.models import AbstractUser class User(AbstractUser): username = models.CharField(max_length=255) class Profile(models.Model): # https://docs.djangoproject.com/en/3.1/topics/db/ex...
from django.db import models from django.conf import settings from django.contrib.auth.models import AbstractUser class User(AbstractUser): username = models.CharField(max_length=255) class Profile(models.Model): # https://docs.djangoproject.com/en/3.1/topics/db/examples/one_to_one/#one-to-one-relationship...
en
0.740046
# https://docs.djangoproject.com/en/3.1/topics/db/examples/one_to_one/#one-to-one-relationships
2.500115
3
qiskit_acqua/ising/testgraphpartition.py
adcorcol/qiskit-acqua
1
6627073
<reponame>adcorcol/qiskit-acqua from qiskit_acqua import Operator, run_algorithm, get_algorithm_instance from qiskit_acqua.input import get_input_instance from qiskit_acqua.ising import graphpartition import numpy as np # w = maxcut.parse_gset_format('sample.maxcut') # qubitOp, offset = maxcut.get_maxcut_qubitops(w) ...
from qiskit_acqua import Operator, run_algorithm, get_algorithm_instance from qiskit_acqua.input import get_input_instance from qiskit_acqua.ising import graphpartition import numpy as np # w = maxcut.parse_gset_format('sample.maxcut') # qubitOp, offset = maxcut.get_maxcut_qubitops(w) # algo_input = get_input_instanc...
en
0.203574
# w = maxcut.parse_gset_format('sample.maxcut') # qubitOp, offset = maxcut.get_maxcut_qubitops(w) # algo_input = get_input_instance('EnergyInput') # algo_input.qubit_op = qubitOp # print('objective function:', maxcut.maxcut_obj(result, offset)) # brute-force way. # [2:] to chop off the "0b" part # not balanced # if 'VQ...
2.144346
2
utils/nn/modules/attention.py
roshanr11/Research-DCST
5
6627074
<gh_stars>1-10 import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter class BiAAttention(nn.Module): ''' Bi-Affine attention layer. ''' def __init__(self, input_size_encoder, input_size_decoder, num_labels, biaffine=True, **kwargs): ''' ...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter class BiAAttention(nn.Module): ''' Bi-Affine attention layer. ''' def __init__(self, input_size_encoder, input_size_decoder, num_labels, biaffine=True, **kwargs): ''' Args: ...
en
0.546189
Bi-Affine attention layer. Args: input_size_encoder: int the dimension of the encoder input. input_size_decoder: int the dimension of the decoder input. num_labels: int the number of labels of the crf layer biaffine: bool ...
2.61953
3
up/tasks/det/plugins/condinst/models/postprocess/__init__.py
ModelTC/EOD
196
6627075
<gh_stars>100-1000 from .condinst_postprocess import * # noqa from .condinst_predictor import * # noqa from .condinst_supervisor import * # noqa
from .condinst_postprocess import * # noqa from .condinst_predictor import * # noqa from .condinst_supervisor import * # noqa
uz
0.446344
# noqa # noqa # noqa
0.904537
1
riddles/admin.py
dan-brown/RiddleBase
1
6627076
from django.contrib import admin from riddles.models import Riddle, RiddleCategory, RiddleState, RiddleType admin.site.register(RiddleCategory) admin.site.register(RiddleType) admin.site.register(Riddle) admin.site.register(RiddleState)
from django.contrib import admin from riddles.models import Riddle, RiddleCategory, RiddleState, RiddleType admin.site.register(RiddleCategory) admin.site.register(RiddleType) admin.site.register(Riddle) admin.site.register(RiddleState)
none
1
1.276761
1
tests/test_consistentpangenomevariations.py
iqbal-lab-org/pangenome_variations
0
6627077
from unittest import TestCase from unittest.mock import Mock, PropertyMock, patch from collections import defaultdict import pandas as pd from io import StringIO from src.ConsistentPangenomeVariations import ConsistentPangenomeVariations, InconsistentPangenomeVariations from src.DeduplicatedVariationsDataframe import ...
from unittest import TestCase from unittest.mock import Mock, PropertyMock, patch from collections import defaultdict import pandas as pd from io import StringIO from src.ConsistentPangenomeVariations import ConsistentPangenomeVariations, InconsistentPangenomeVariations from src.DeduplicatedVariationsDataframe import ...
en
0.295022
# setup # setup dummy 0 1 2 3 dummy,ref_genome,query_genome,present_in_a_consistent_pangenome_variation,pangenome_variation_id,number_of_alleles,ref_allele_id,query_allele_id,number_of_different_allele_sequences,ref_allele_sequence_id,query_allele_sequence_id,nb_of_sample...
2.577021
3
local/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/__init__.py
sahilsdei/django_ecommerce
2
6627078
<gh_stars>1-10 ########################################################################## # # pgAdmin 4 - PostgreSQL Tools # # Copyright (C) 2013 - 2018, The pgAdmin Development Team # This software is released under the PostgreSQL Licence # ########################################################################## ""...
########################################################################## # # pgAdmin 4 - PostgreSQL Tools # # Copyright (C) 2013 - 2018, The pgAdmin Development Team # This software is released under the PostgreSQL Licence # ########################################################################## """Implements Rul...
en
0.708253
########################################################################## # # pgAdmin 4 - PostgreSQL Tools # # Copyright (C) 2013 - 2018, The pgAdmin Development Team # This software is released under the PostgreSQL Licence # ########################################################################## Implements Rule No...
1.752408
2
corrscope/channel.py
Lactozilla/corrscope
0
6627079
<gh_stars>0 from enum import unique, auto from os.path import abspath from pathlib import Path from typing import TYPE_CHECKING, Optional, Union, Dict, Any import attr from ruamel.yaml.comments import CommentedMap from corrscope.config import ( DumpableAttrs, Alias, CorrError, evolve_compat, Typed...
from enum import unique, auto from os.path import abspath from pathlib import Path from typing import TYPE_CHECKING, Optional, Union, Dict, Any import attr from ruamel.yaml.comments import CommentedMap from corrscope.config import ( DumpableAttrs, Alias, CorrError, evolve_compat, TypedEnumDump, ) ...
en
0.719044
# Supplying a dict inherits attributes from global trigger. # TODO test channel-specific triggers # Multiplies how wide the window is, in milliseconds. # Overrides global amplification. # Stereo config # region Legacy Fields # endregion # trigger_samp is unneeded, since __init__ (not CorrScope) constructs triggers. # P...
2.059231
2
tensor2tensor/models/research/aligned.py
xueeinstein/tensor2tensor
0
6627080
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
en
0.654219
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
1.673375
2
podcast-backend/src/app/pcasts/controllers/search_series_controller.py
cuappdev/archives
0
6627081
from . import * class SearchSeriesController(AppDevController): def get_path(self): return '/search/series/<query>/' def get_methods(self): return ['GET'] @authorize def content(self, **kwargs): user_id = kwargs.get('user').id search_name = request.view_args['query'] offset = request.arg...
from . import * class SearchSeriesController(AppDevController): def get_path(self): return '/search/series/<query>/' def get_methods(self): return ['GET'] @authorize def content(self, **kwargs): user_id = kwargs.get('user').id search_name = request.view_args['query'] offset = request.arg...
none
1
2.072625
2
scripts/version.py
framawiki/pywikibot
0
6627082
<gh_stars>0 #!/usr/bin/python # -*- coding: utf-8 -*- """Script to determine the Pywikibot version (tag, revision and date).""" # # (C) Pywikibot team, 2007-2020 # # Distributed under the terms of the MIT license. # import codecs import os import sys import pywikibot from pywikibot.version import getversion, get_tool...
#!/usr/bin/python # -*- coding: utf-8 -*- """Script to determine the Pywikibot version (tag, revision and date).""" # # (C) Pywikibot team, 2007-2020 # # Distributed under the terms of the MIT license. # import codecs import os import sys import pywikibot from pywikibot.version import getversion, get_toolforge_hostna...
en
0.654394
#!/usr/bin/python # -*- coding: utf-8 -*- Script to determine the Pywikibot version (tag, revision and date). # # (C) Pywikibot team, 2007-2020 # # Distributed under the terms of the MIT license. # Fake requests instance. Print environment variable. Print pywikibot version and important settings.
2.60877
3
hexrd/ui/color_map_editor.py
bnmajor/hexrdgui
0
6627083
<reponame>bnmajor/hexrdgui import copy from matplotlib import cm import matplotlib.colors import numpy as np import hexrd.ui.constants from hexrd.ui.ui_loader import UiLoader class ColorMapEditor: def __init__(self, image_object, parent=None): # The image_object can be any object with the following fu...
import copy from matplotlib import cm import matplotlib.colors import numpy as np import hexrd.ui.constants from hexrd.ui.ui_loader import UiLoader class ColorMapEditor: def __init__(self, image_object, parent=None): # The image_object can be any object with the following functions: # 1. set_c...
en
0.747344
# The image_object can be any object with the following functions: # 1. set_cmap: a function to set the cmap on the image # 2. set_norm: a function to set the norm on the image # Set the combobox to be the default # We can't do this in PySide2 for some reason: # self.ui.maximum.valueChanged.connect(self.ui.minimum.setM...
2.575002
3
dbpedia_links_rating/rating/views.py
RPOD/DBpedia-Links-Rating
0
6627084
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.views.generic import TemplateView, UpdateView, DetailView from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib import messages from django.shortcuts import redirect from django.contrib.contenttypes.mod...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.views.generic import TemplateView, UpdateView, DetailView from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib import messages from django.shortcuts import redirect from django.contrib.contenttypes.mod...
en
0.941722
# -*- coding: utf-8 -*- # NOQA # Current user HAS rated this object # Updates his rating and total score # Current user has NOT rated this object # Saves first new rating # Saves first new total score, same value as new rating
1.992928
2
marvelo_adapter.py
timokau/task-placement
1
6627085
"""Imports marvelo problems and results from csv""" import os import math import re import csv import numpy as np from infrastructure import InfrastructureNetwork from overlay import OverlayNetwork from embedding import PartialEmbedding def csv_to_list(csvfile, sep=","): """Parses a csv file into a 2d array, ig...
"""Imports marvelo problems and results from csv""" import os import math import re import csv import numpy as np from infrastructure import InfrastructureNetwork from overlay import OverlayNetwork from embedding import PartialEmbedding def csv_to_list(csvfile, sep=","): """Parses a csv file into a 2d array, ig...
en
0.822035
Imports marvelo problems and results from csv Parses a csv file into a 2d array, ignoring the header # skip header Reads an overlay in MARVELOs format from file # read the files # construct the overlay from the gathered info Reads an infrastructure definition in MARVELO format from csvs # read the files # the positions...
2.873246
3
Scrapers/pcmagUrlsScraper.py
sydneyhill3901/CSI2999
0
6627086
import requests, time, csv from bs4 import BeautifulSoup # listPageRootUrl is "https://www.pcmag.com/categories/mobile-phones?page=" # pageNumber is the page number on PCMag site to scrape # write=True writes scraped URLs to CSV file in format phoneName|url def getReviews(listPageRootUrl, pageNumber, write=Tru...
import requests, time, csv from bs4 import BeautifulSoup # listPageRootUrl is "https://www.pcmag.com/categories/mobile-phones?page=" # pageNumber is the page number on PCMag site to scrape # write=True writes scraped URLs to CSV file in format phoneName|url def getReviews(listPageRootUrl, pageNumber, write=Tru...
en
0.852576
# listPageRootUrl is "https://www.pcmag.com/categories/mobile-phones?page=" # pageNumber is the page number on PCMag site to scrape # write=True writes scraped URLs to CSV file in format phoneName|url # listPageRootUrl is "https://www.pcmag.com/categories/mobile-phones?page=" # pageNumber is the page number on PCMag si...
3.186912
3
solidata_api/_auth/auth_distant_protocols.py
co-demos/solidata-backend
2
6627087
""" auth_distant_protocols.py """ from log_config import log, pprint, pformat log.debug (">>> _auth ... loading auth_distant_protocols ...") functions_protocols = { ### DONE "token_claims" : { "endpoint_config" : "auth_tokens", "endpoint_code" : "token_claims", }, # TESTS TO DO "confirm_acces...
""" auth_distant_protocols.py """ from log_config import log, pprint, pformat log.debug (">>> _auth ... loading auth_distant_protocols ...") functions_protocols = { ### DONE "token_claims" : { "endpoint_config" : "auth_tokens", "endpoint_code" : "token_claims", }, # TESTS TO DO "confirm_acces...
en
0.190646
auth_distant_protocols.py ### DONE # TESTS TO DO ### DONE ### DONE ### TESTS TO DO ### TESTS TO DO # ### TO DO # "add_claims_to_access_token" : { # "endpoint_config" : "users_list", # "endpoint_code" : "get_one", # }, # ### TO DO # "user_identity_lookup" : { # "endpoint_config" : "users_list", # "endpoint_code"...
2.237887
2
api/drinks/tests/tags.py
gthole/drink-stash
7
6627088
<reponame>gthole/drink-stash<filename>api/drinks/tests/tags.py from datetime import timedelta from django.utils.timezone import now from rest_framework.test import APIClient from drinks.models import Tag from .base import BaseTestCase class TagTestCase(BaseTestCase): def test_fetch_tags(self): Tag.objects...
from datetime import timedelta from django.utils.timezone import now from rest_framework.test import APIClient from drinks.models import Tag from .base import BaseTestCase class TagTestCase(BaseTestCase): def test_fetch_tags(self): Tag.objects.create(name='sour') Tag.objects.create(name='bitter') ...
none
1
2.221169
2
san_antonio/san_antonio.py
NicolasFlandrois/My-Mini-Py-Scripts-Training
0
6627089
<reponame>NicolasFlandrois/My-Mini-Py-Scripts-Training<gh_stars>0 # -*- coding: utf8 -*- quotes = [ "Ecoutez-moi, <NAME>, nous avons beau être ou ne pas être, nous sommes !", "On doit pouvoir choisir entre s'écouter parler et se faire entendre." ] characters = [ "alvin et les Chipmunks", "Babar", "<NAME>", "cal...
# -*- coding: utf8 -*- quotes = [ "Ecoutez-moi, <NAME>, nous avons beau être ou ne pas être, nous sommes !", "On doit pouvoir choisir entre s'écouter parler et se faire entendre." ] characters = [ "alvin et les Chipmunks", "Babar", "<NAME>", "calimero", "casper", "le chat potté", "Kirikou" ] def get_random_...
en
0.347731
# -*- coding: utf8 -*- This fonction show a random quote from a list. # import random # n = random.randrange(0, 2, 2)
4.0644
4
src/compas_ghpython/artists/mixins/faceartist.py
elidim/compas
1
6627090
from __future__ import print_function from __future__ import absolute_import from __future__ import division import compas from compas.utilities import color_to_colordict import compas_ghpython try: import Rhino except ImportError: compas.raise_if_ironpython() __all__ = ['FaceArtist'] class FaceArtist(o...
from __future__ import print_function from __future__ import absolute_import from __future__ import division import compas from compas.utilities import color_to_colordict import compas_ghpython try: import Rhino except ImportError: compas.raise_if_ironpython() __all__ = ['FaceArtist'] class FaceArtist(o...
en
0.712484
Draw a selection of faces. Parameters ---------- fkeys : list A list of face keys identifying which faces to draw. The default is ``None``, in which case all faces are drawn. color : str, tuple, dict The color specififcation for the faces. ...
2.726663
3
treeio/account/migrations/0001_initial.py
Andrea-MariaDB-2/treeio
242
6627091
<reponame>Andrea-MariaDB-2/treeio<filename>treeio/account/migrations/0001_initial.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial'), ] opera...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial'), ] operations = [ migrations.CreateModel( name='Notification', ...
en
0.769321
# -*- coding: utf-8 -*-
1.855903
2
nanoAPI/handler/router.py
Nandan-unni/Nano
2
6627092
<filename>nanoAPI/handler/router.py from nanoAPI.utils import parse_route class Router: def __init__(self): self.routes = [] def get(self, route: str, controller): parsed_route = parse_route(route) parsed_route["method"] = "GET" parsed_route["controller"] = controller ...
<filename>nanoAPI/handler/router.py from nanoAPI.utils import parse_route class Router: def __init__(self): self.routes = [] def get(self, route: str, controller): parsed_route = parse_route(route) parsed_route["method"] = "GET" parsed_route["controller"] = controller ...
none
1
2.871114
3
EXIFnaming/nameop.py
mvolkert/EXIFnaming
0
6627093
<filename>EXIFnaming/nameop.py #!/usr/bin/env python3 """ Organizing fotos according to naming conventions definied by readexif.rename and external programs dependencies: - """ import codecs import csv import datetime as dt import os import re from typing import Optional, Match, Iterable, Any, IO, Tuple, List import ...
<filename>EXIFnaming/nameop.py #!/usr/bin/env python3 """ Organizing fotos according to naming conventions definied by readexif.rename and external programs dependencies: - """ import codecs import csv import datetime as dt import os import re from typing import Optional, Match, Iterable, Any, IO, Tuple, List import ...
en
0.803134
#!/usr/bin/env python3 Organizing fotos according to naming conventions definied by readexif.rename and external programs dependencies: - put each kind of series in its own directory # TLM: Timelapse manual - pictures on different days to be combined to a Timelapse #dirs:%d #files:%d", dirpath, len(dirnames), len(file...
1.99111
2
core/backend/djacket/urls.py
Djacket/djacket
85
6627094
<reponame>Djacket/djacket from django.conf import settings from django.contrib import admin from django.views.static import serve from django.conf.urls import include, url from user.views import user_deposit from djacket.views import index # Djacket main urls will be addressed here. urlpatterns = [ url(r'^admin...
from django.conf import settings from django.contrib import admin from django.views.static import serve from django.conf.urls import include, url from user.views import user_deposit from djacket.views import index # Djacket main urls will be addressed here. urlpatterns = [ url(r'^admin/doc/', include('django.co...
en
0.815429
# Djacket main urls will be addressed here. # project docs view. # admin interface. # import repository app urls with no prefix. # import user app urls with 'account' prefix. # show user deposit for url '/username'. # index changes to logged in user if he/she is authenticated or to djacket intro if not. # serve static ...
2.063095
2
submissions/abc156/b.py
m-star18/atcoder
1
6627095
<gh_stars>1-10 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) def Base_10_to_n(X, n): if int(X / n): return Base_10_to_n(int(X / n), n) + str(X % n) return str(X % n) n, k = map(int, readline().split(...
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) def Base_10_to_n(X, n): if int(X / n): return Base_10_to_n(int(X / n), n) + str(X % n) return str(X % n) n, k = map(int, readline().split()) print(len(Ba...
none
1
2.953619
3
pywizlight/__init__.py
UH-60/pywizlight
221
6627096
<filename>pywizlight/__init__.py<gh_stars>100-1000 from pywizlight.bulb import PilotBuilder, PilotParser, wizlight from pywizlight import discovery from pywizlight.scenes import SCENES from pywizlight.bulblibrary import BulbType __all__ = [ "BulbType", "discovery", "PilotBuilder", "PilotParser", "...
<filename>pywizlight/__init__.py<gh_stars>100-1000 from pywizlight.bulb import PilotBuilder, PilotParser, wizlight from pywizlight import discovery from pywizlight.scenes import SCENES from pywizlight.bulblibrary import BulbType __all__ = [ "BulbType", "discovery", "PilotBuilder", "PilotParser", "...
none
1
1.483598
1
layers/__init__.py
exityan/reid-strong-baseline
0
6627097
<gh_stars>0 # encoding: utf-8 """ @author: liaoxingyu @contact: <EMAIL> """ import torch.nn.functional as F from .triplet_loss import TripletLoss, CrossEntropyLabelSmooth from .center_loss import CenterLoss def make_loss(cfg, num_classes): # modified by gu sampler = cfg.DATALOADER.SAMPLER if cfg.MODEL.M...
# encoding: utf-8 """ @author: liaoxingyu @contact: <EMAIL> """ import torch.nn.functional as F from .triplet_loss import TripletLoss, CrossEntropyLabelSmooth from .center_loss import CenterLoss def make_loss(cfg, num_classes): # modified by gu sampler = cfg.DATALOADER.SAMPLER if cfg.MODEL.METRIC_LOSS_T...
en
0.793926
# encoding: utf-8 @author: liaoxingyu @contact: <EMAIL> # modified by gu # triplet loss # new add by luo # modified by gu # center loss # triplet loss # center loss # new add by luo
2.183752
2
GununMaddesi.py
ahmetlii/GununMaddesi
0
6627098
# -*- coding: utf-8 -*- # !/usr/bin/python import mavri import datetime from random import randint wiki = 'tr.wikipedia' username='Mavrikant Bot' xx = mavri.login(wiki, username) one_day = datetime.timedelta(days=1) baslangic = datetime.date(2015, 9, 1) # Bu tarihten öncesinde GM sorunlu. bugun = datetime.date(date...
# -*- coding: utf-8 -*- # !/usr/bin/python import mavri import datetime from random import randint wiki = 'tr.wikipedia' username='Mavrikant Bot' xx = mavri.login(wiki, username) one_day = datetime.timedelta(days=1) baslangic = datetime.date(2015, 9, 1) # Bu tarihten öncesinde GM sorunlu. bugun = datetime.date(date...
tr
0.999197
# -*- coding: utf-8 -*- # !/usr/bin/python # Bu tarihten öncesinde GM sorunlu. # 2 gün sonrası için kontrol yap # Başlangıç ve Bugün arasında rasgele bir tarih seç # Yarının GM sayfası yok # Kaynak sayfa bul ve içeriğini kopyala # Sayfa boş çıktı. Sonraki güne geç. # Kaynak sayfa ile gelecek GM sayfasını oluştur # Yarı...
2.800514
3
pytests/test_BoundaryDetector.py
calumcorrie/Meraki-Crowd-Interface
0
6627099
import os import sys import numpy as np # import BoundaryDetector from lib directory parentddir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) sys.path.append(parentddir) from lib.BoundaryDetector import BoundaryDetector # generate expected map expected_sym_map = np.ones((100,100),dtype=...
import os import sys import numpy as np # import BoundaryDetector from lib directory parentddir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) sys.path.append(parentddir) from lib.BoundaryDetector import BoundaryDetector # generate expected map expected_sym_map = np.ones((100,100),dtype=...
en
0.475491
# import BoundaryDetector from lib directory # generate expected map
2.355141
2
tests/test_maybe.py
darkfeline/mir.monads
0
6627100
<gh_stars>0 # Copyright (C) 2016 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
# Copyright (C) 2016 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
en
0.844457
# Copyright (C) 2016 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
2.316909
2
users-profils-Q/Tests/test_profiles_service_request.py
Enaifuos/Recommandation-System-Food-Eatrack-Application
0
6627101
import sys import unittest from collections import OrderedDict #sys.path.append("..") from src.client_side import profiles_service_requester as rq import pandas as pd import os package_dir = os.path.dirname(os.path.abspath(__file__)) class profiles_service_requester_test(unittest.TestCase): """Test case utili...
import sys import unittest from collections import OrderedDict #sys.path.append("..") from src.client_side import profiles_service_requester as rq import pandas as pd import os package_dir = os.path.dirname(os.path.abspath(__file__)) class profiles_service_requester_test(unittest.TestCase): """Test case utili...
fr
0.984008
#sys.path.append("..") Test case utilisé pour tester les fonctionnalités du module profile_service_requester # pas utilisé pour l'instant ! #print("\n") #print(profiles_file[profiles_file['user_id'] == int(self.existant_id)]) Test case utilisé pour tester récupération du profil d'un utilisateur existant Test case utili...
2.700447
3
src/models/debug_fetch_data.py
voreille/plc_seg
0
6627102
<reponame>voreille/plc_seg import os from pathlib import Path from random import shuffle import datetime import dotenv import h5py import pandas as pd from src.models.fetch_data_from_hdf5 import get_tf_data project_dir = Path(__file__).resolve().parents[2] dotenv_path = project_dir / ".env" dotenv.load_dotenv(str(do...
import os from pathlib import Path from random import shuffle import datetime import dotenv import h5py import pandas as pd from src.models.fetch_data_from_hdf5 import get_tf_data project_dir = Path(__file__).resolve().parents[2] dotenv_path = project_dir / ".env" dotenv.load_dotenv(str(dotenv_path)) log_dir = proje...
none
1
2.160693
2
recurring_content_detector/keras_rmac/__init__.py
busterbeam/recurring-content-detector
1
6627103
from . import rmac
from . import rmac
none
1
1.096897
1
entropylab/graph_experiment.py
IgorQM/entropy
0
6627104
<reponame>IgorQM/entropy<filename>entropylab/graph_experiment.py import asyncio import enum import sys import traceback from copy import deepcopy from datetime import datetime from inspect import signature, iscoroutinefunction, getfullargspec from itertools import count from typing import Optional, Dict, Any, S...
import asyncio import enum import sys import traceback from copy import deepcopy from datetime import datetime from inspect import signature, iscoroutinefunction, getfullargspec from itertools import count from typing import Optional, Dict, Any, Set, Union, Callable, Coroutine, Iterable from graphviz import ...
en
0.782901
decorator for running using the given python function as a PyNode :param label: node label :param input_vars: dictionary of node inputs, keys are input names. the input values should be defined as the following: >>>input_vars={"a": node.outputs["x"]} ...
2.635437
3
livecoin/spiders/crypto.py
Mario-D93/livecoin
0
6627105
# -*- coding: utf-8 -*- import scrapy from scrapy_splash import SplashRequest from datetime import date class CryptoSpider(scrapy.Spider): name = 'crypto' allowed_domains = ['www.livecoin.net/en'] script = ''' function main(splash, args) splash.private_mode_enabled = False ...
# -*- coding: utf-8 -*- import scrapy from scrapy_splash import SplashRequest from datetime import date class CryptoSpider(scrapy.Spider): name = 'crypto' allowed_domains = ['www.livecoin.net/en'] script = ''' function main(splash, args) splash.private_mode_enabled = False ...
en
0.333476
# -*- coding: utf-8 -*- function main(splash, args) splash.private_mode_enabled = False assert(splash:go(args.url)) splash:wait(1) btn = splash:select_all(".filterPanelItem___2z5Gb") btn[3]:mouse_click() splash:wait(1) ...
2.706578
3
src/Random.py
eatPorkAndSeePigRun/ReliableTransport
0
6627106
# coding: utf-8 import random class Random(object): """ 这个类的代码不能修改 """ """ 一个均匀的随机数生成器 """ def __init__(self, size=100): self.size = 0 self.seeds = [] for i in range(size): self.seeds.append(0) def random(self): if len(self.seeds) == 0: return ...
# coding: utf-8 import random class Random(object): """ 这个类的代码不能修改 """ """ 一个均匀的随机数生成器 """ def __init__(self, size=100): self.size = 0 self.seeds = [] for i in range(size): self.seeds.append(0) def random(self): if len(self.seeds) == 0: return ...
zh
0.992744
# coding: utf-8 这个类的代码不能修改 一个均匀的随机数生成器
3.408604
3
app/ingest/domain/services/process_service.py
harvard-lts/import-management-service
0
6627107
<filename>app/ingest/domain/services/process_service.py """ This module defines a ProcessService, which is a domain service that defines Process operations. """ from logging import Logger from app.ingest.domain.services.exceptions.ingest_service_exception import IngestServiceException from app.ingest.domain.services....
<filename>app/ingest/domain/services/process_service.py """ This module defines a ProcessService, which is a domain service that defines Process operations. """ from logging import Logger from app.ingest.domain.services.exceptions.ingest_service_exception import IngestServiceException from app.ingest.domain.services....
en
0.445842
This module defines a ProcessService, which is a domain service that defines Process operations. Handles a Process Status message. :param message_body: message body :type message_body: dict :param message_id: message id :type message_id: str :raises ProcessServiceException
2.385827
2
haystack/fields.py
pbs/django-haystack
2
6627108
<reponame>pbs/django-haystack<gh_stars>1-10 import re from django.utils import datetime_safe from django.template import loader, Context from haystack.exceptions import SearchFieldError class NOT_PROVIDED: pass DATETIME_REGEX = re.compile('^(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})(T|\s+)(?P<hour>\d{2}):(...
import re from django.utils import datetime_safe from django.template import loader, Context from haystack.exceptions import SearchFieldError class NOT_PROVIDED: pass DATETIME_REGEX = re.compile('^(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})(T|\s+)(?P<hour>\d{2}):(?P<minute>\d{2}):(?P<second>\d{2}).*?$') #...
en
0.840489
# All the SearchFields variants. The base implementation of a search field. # Track what the index thinks this field is called. # We supply the facet_class for making it easy to create a faceted # field based off of this field. Returns a boolean of whether this field has a default value. Returns the default value for t...
2.466636
2
pyshley/sys/backup.py
IndiBowstring/pyshley
0
6627109
import os from _datetime import datetime # TODO: delete hint # The current full container list is pyshley.lib.config.foundrySettings['dockerContainers'].keys() def dockerStop(containers: list) -> None: """ Stops each listed container. Parameters: arg1 (list): List of container names. """ p...
import os from _datetime import datetime # TODO: delete hint # The current full container list is pyshley.lib.config.foundrySettings['dockerContainers'].keys() def dockerStop(containers: list) -> None: """ Stops each listed container. Parameters: arg1 (list): List of container names. """ p...
en
0.65728
# TODO: delete hint # The current full container list is pyshley.lib.config.foundrySettings['dockerContainers'].keys() Stops each listed container. Parameters: arg1 (list): List of container names. Starts each listed container. Parameters: arg1 (list): List of container names. " Creates a tarball ...
2.476569
2
src/oci/apm_config/models/create_metric_group_details.py
LaudateCorpus1/oci-python-sdk
0
6627110
<reponame>LaudateCorpus1/oci-python-sdk # coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.ap...
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
en
0.677849
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
1.993859
2
equium/__init__.py
johnpaulett/equium-py
0
6627111
__version__ = '0.0.1' class Object: def __eq__(self, other): return not super().__eq__(other)
__version__ = '0.0.1' class Object: def __eq__(self, other): return not super().__eq__(other)
none
1
1.949007
2
src/sage/categories/category_types.py
fchapoton/sage
2
6627112
""" Specific category classes This is placed in a separate file from categories.py to avoid circular imports (as morphisms must be very low in the hierarchy with the new coercion model). """ from __future__ import absolute_import #***************************************************************************** # Copyri...
""" Specific category classes This is placed in a separate file from categories.py to avoid circular imports (as morphisms must be very low in the hierarchy with the new coercion model). """ from __future__ import absolute_import #***************************************************************************** # Copyri...
en
0.541304
Specific category classes This is placed in a separate file from categories.py to avoid circular imports (as morphisms must be very low in the hierarchy with the new coercion model). #***************************************************************************** # Copyright (C) 2005 <NAME> <<EMAIL>> and # ...
1.948597
2
app/service/learning_svc.py
mihaid-b/caldera
0
6627113
import itertools import glob import re from base64 import b64decode from importlib import import_module from app.objects.secondclass.c_relationship import Relationship from app.objects.secondclass.c_link import update_scores from app.service.interfaces.i_learning_svc import LearningServiceInterface from app.utility.ba...
import itertools import glob import re from base64 import b64decode from importlib import import_module from app.objects.secondclass.c_relationship import Relationship from app.objects.secondclass.c_link import update_scores from app.service.interfaces.i_learning_svc import LearningServiceInterface from app.utility.ba...
en
0.841349
# relationships require at least 2 variables
2.142203
2
beluga/continuation/__init__.py
doublefloyd/beluga
20
6627114
""" Module: continuation """ from beluga.continuation.continuation import (ContinuationList, ContinuationVariable, ManualStrategy, ProductStrategy, BisectionStrategy, run_continuation_set) from beluga.continuation.guess_generators import guess_generator, GuessGenerator, m...
""" Module: continuation """ from beluga.continuation.continuation import (ContinuationList, ContinuationVariable, ManualStrategy, ProductStrategy, BisectionStrategy, run_continuation_set) from beluga.continuation.guess_generators import guess_generator, GuessGenerator, m...
fr
0.108381
Module: continuation
1.475788
1
describe.py
jeffh/describe
3
6627115
<gh_stars>1-10 #!/usr/bin/env python import os execfile( os.path.join(os.path.abspath(os.path.dirname(__file__)), 'describe', 'main.py') )
#!/usr/bin/env python import os execfile( os.path.join(os.path.abspath(os.path.dirname(__file__)), 'describe', 'main.py') )
ru
0.26433
#!/usr/bin/env python
1.224636
1
BeiKeZuFangSpider/spiders/BeiKeSpider.py
sunhailin-Leo/BeiKeZuFangSpider
4
6627116
# -*- coding: UTF-8 -*- """ Created on 2018年9月17日 @author: Leo """ import re import uuid from collections import OrderedDict # Scrapy import scrapy # 项目内部库 from BeiKeZuFangSpider.utils.city_util import CityInfoSpider from BeiKeZuFangSpider.utils.common_utils import DictMatching, flatten class BeiKeScrapySpider(scra...
# -*- coding: UTF-8 -*- """ Created on 2018年9月17日 @author: Leo """ import re import uuid from collections import OrderedDict # Scrapy import scrapy # 项目内部库 from BeiKeZuFangSpider.utils.city_util import CityInfoSpider from BeiKeZuFangSpider.utils.common_utils import DictMatching, flatten class BeiKeScrapySpider(scra...
zh
0.860542
# -*- coding: UTF-8 -*- Created on 2018年9月17日 @author: Leo # Scrapy # 项目内部库 数据初始化 :param city: 城市名称 :param area: 区域名称 :param metro: 地铁线路名称 # 启动的爬虫的URL # 城市 # 城市不能为空 # 存在当前城市的二手房数据 # 爬取当前城市的全量数据 # 总页数 # 开始爬取第一页 #contentList".format(self.start_urls[0], 1), # 房屋数据字典(为了兼容其他3.X版本使用了有序字典OrderDict) # 房...
2.519023
3
test/trainer_class_test.py
SamiIbishi/applied-machine-learning
7
6627117
import torch import torchvision from src.utils import utils_tensorboard from src.data_loader.FaceRecognitionDataset import FaceRecognitionDataset from src.data_loader import DataSplitter from src.model.FaceNet import FaceNet from src.trainer.FaceNetTrainer import FaceNetTrainer import time import src.utils.utils_image...
import torch import torchvision from src.utils import utils_tensorboard from src.data_loader.FaceRecognitionDataset import FaceRecognitionDataset from src.data_loader import DataSplitter from src.model.FaceNet import FaceNet from src.trainer.FaceNetTrainer import FaceNetTrainer import time import src.utils.utils_image...
en
0.829459
# write graph of model to tensorboard # tensorboard_writer.add_graph(model, images) # write sample images to tensorboard # Deleting image variables to free RAM
2.202111
2
Python/0191_number_of_1_bits.py
codingyen/CodeAlone
2
6627118
<filename>Python/0191_number_of_1_bits.py # Try to use bit manipulation. class Solution: def hammingWeight(self, n): b = bin(n)[2:] counter = 0 for i in b: if i == '1': counter += 1 return counter if __name__ == "__main__": n = 11 s = Solution()...
<filename>Python/0191_number_of_1_bits.py # Try to use bit manipulation. class Solution: def hammingWeight(self, n): b = bin(n)[2:] counter = 0 for i in b: if i == '1': counter += 1 return counter if __name__ == "__main__": n = 11 s = Solution()...
en
0.848346
# Try to use bit manipulation.
3.384423
3
slope/gaussian_hill_grad.py
UP-RS-ESP/GEW-DAP04-WS201819
2
6627119
import numpy as np from matplotlib import pyplot as pl shape = (14, 20) width = 0.15 xstart = -1.5 ystart = -1.1 xb = np.arange(xstart, xstart+(shape[1]+1) * width, width) yb = np.arange(ystart, ystart+(shape[0]+1) * width, width) xc = xb[:-1] + width/2 yc = yb[:-1] + width/2 X, Y = np.meshgrid(xc, yc) dem = np.exp(-...
import numpy as np from matplotlib import pyplot as pl shape = (14, 20) width = 0.15 xstart = -1.5 ystart = -1.1 xb = np.arange(xstart, xstart+(shape[1]+1) * width, width) yb = np.arange(ystart, ystart+(shape[0]+1) * width, width) xc = xb[:-1] + width/2 yc = yb[:-1] + width/2 X, Y = np.meshgrid(xc, yc) dem = np.exp(-...
none
1
2.260411
2
imagespace/server/imageprefix_rest.py
amirhosf/image_space
0
6627120
<filename>imagespace/server/imageprefix_rest.py #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in complianc...
<filename>imagespace/server/imageprefix_rest.py #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in complianc...
en
0.565926
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 t...
2.019131
2
galaxy/api/views/views.py
bmclaughlin/galaxy
904
6627121
<gh_stars>100-1000 # (c) 2012-2018, Ansible by Red Hat # # This file is part of Ansible Galaxy # # Ansible Galaxy is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by # the Apache Software Foundation, either version 2 of the License, or # (at your option) an...
# (c) 2012-2018, Ansible by Red Hat # # This file is part of Ansible Galaxy # # Ansible Galaxy is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by # the Apache Software Foundation, either version 2 of the License, or # (at your option) any later version. # ...
en
0.801559
# (c) 2012-2018, Ansible by Red Hat # # This file is part of Ansible Galaxy # # Ansible Galaxy is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by # the Apache Software Foundation, either version 2 of the License, or # (at your option) any later version. # ...
1.45225
1
yt_dlp/extractor/arte.py
ouwou/yt-dlp
2
6627122
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( ExtractorError, int_or_none, parse_qs, qualities, try_get, unified_strdate, url_or_none, ) class ArteTVBaseIE(InfoExtractor):...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( ExtractorError, int_or_none, parse_qs, qualities, try_get, unified_strdate, url_or_none, ) class ArteTVBaseIE(InfoExtractor):...
en
0.816777
# coding: utf-8 (?x) https?:// (?: (?:www\.)?arte\.tv/(?P<lang>%(langs)s)/videos| api\.arte\.tv/api/player/v\d+/config/(?P<lang_2>%(langs)s) ) /(?P<id>\d{6}-\d{3}-[AF]) # L...
2.012004
2
evaluate.py
nihalsid/texture_fields
78
6627123
<reponame>nihalsid/texture_fields import argparse import pandas as pd import os import glob from mesh2tex import config from mesh2tex.eval import evaluate_generated_images categories = {'02958343': 'cars', '03001627': 'chairs', '02691156': 'airplanes', '04379243': 'tables', '02828884': 'be...
import argparse import pandas as pd import os import glob from mesh2tex import config from mesh2tex.eval import evaluate_generated_images categories = {'02958343': 'cars', '03001627': 'chairs', '02691156': 'airplanes', '04379243': 'tables', '02828884': 'benches', '02933112': 'cabinets', ...
none
1
2.513184
3
step1/taptap.py
karoyqiu/xbmc-kodi-private-china-addons
420
6627124
<reponame>karoyqiu/xbmc-kodi-private-china-addons #编辑推荐视频列表 import json import requests from bs4 import BeautifulSoup url = 'https://www.taptap.com/webapiv2/video/v1/refresh?type=editors_choice&from=1&limit=10&X-UA=V%3D1%26PN%3DWebApp%26LANG%3Dzh_CN%26VN%3D0.1.0%26LOC%3DCN%26PLT%3DPC' headers = {'user-agent' : 'Mozi...
#编辑推荐视频列表 import json import requests from bs4 import BeautifulSoup url = 'https://www.taptap.com/webapiv2/video/v1/refresh?type=editors_choice&from=1&limit=10&X-UA=V%3D1%26PN%3DWebApp%26LANG%3Dzh_CN%26VN%3D0.1.0%26LOC%3DCN%26PLT%3DPC' headers = {'user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/5...
zh
0.150416
#编辑推荐视频列表 #print(rec.text) #print(j['data']) #为你推荐视频列表 #print(rec.text) #print(j['data']) #由视频链接爬出视频m3u8 #print(rectext[str1+17:str2-1]) #print(type(mainm3u8)) #print(mainm3u8) #j = json.loads(rec.text) #print(j['data']) #print(rectext) # 查找数字 # 查找数字 #print(m3u8url) #排行榜 #print(rec.text) #游戏分类 #print(rec.text) #详情获取视频 ...
2.994557
3
utils/loss/dice_loss.py
bhklab/ptl-oar-segmentation
3
6627125
""" get_tp_fp_fn, SoftDiceLoss, and DC_and_CE/TopK_loss are from https://github.com/MIC-DKFZ/nnUNet/blob/master/nnunet/training/loss_functions """ import torch from .ND_Crossentropy import CrossentropyND, TopKLoss, WeightedCrossEntropyLoss from torch import nn from torch.autograd import Variable from torch imp...
""" get_tp_fp_fn, SoftDiceLoss, and DC_and_CE/TopK_loss are from https://github.com/MIC-DKFZ/nnUNet/blob/master/nnunet/training/loss_functions """ import torch from .ND_Crossentropy import CrossentropyND, TopKLoss, WeightedCrossEntropyLoss from torch import nn from torch.autograd import Variable from torch imp...
en
0.671026
get_tp_fp_fn, SoftDiceLoss, and DC_and_CE/TopK_loss are from https://github.com/MIC-DKFZ/nnUNet/blob/master/nnunet/training/loss_functions # copy from: https://github.com/MIC-DKFZ/nnUNet/blob/master/nnunet/utilities/nd_softmax.py # copy from: https://github.com/MIC-DKFZ/nnUNet/blob/master/nnunet/utilities/tensor_utilit...
2.060425
2
Calibrador.py
osmarnds/DeMOLidor
1
6627126
<filename>Calibrador.py # -*- coding: utf-8 -*- #!/usr/bin/env python ####################################################################### ##### ##### ##### <NAME> ##### ##### <EMAIL> ...
<filename>Calibrador.py # -*- coding: utf-8 -*- #!/usr/bin/env python ####################################################################### ##### ##### ##### <NAME> ##### ##### <EMAIL> ...
en
0.204993
# -*- coding: utf-8 -*- #!/usr/bin/env python ####################################################################### ##### ##### ##### <NAME> ##### ##### <EMAIL> ##### ##### ...
2.706042
3
solution/longestValidParentheses.py
ccwwonebyone/leetcode
0
6627127
from typing import List class Solution: def longestValidParentheses(self, s: str) -> int: res = 0 stack = [-1] for i, chars in enumerate(s): if chars == "(": stack.append(i) else: stack.pop() if not stack: ...
from typing import List class Solution: def longestValidParentheses(self, s: str) -> int: res = 0 stack = [-1] for i, chars in enumerate(s): if chars == "(": stack.append(i) else: stack.pop() if not stack: ...
none
1
3.454796
3
4/oop16.py
ikramulkayes/Python_season2
0
6627128
class Author: def __init__(self,*args): if len(args)==0: self.name = "Default" self.books = [] elif len(args) == 1: self.name = args[0] self.books = [] else: self.name = args[0] self.books = args[1::] self.bo...
class Author: def __init__(self,*args): if len(args)==0: self.name = "Default" self.books = [] elif len(args) == 1: self.name = args[0] self.books = [] else: self.name = args[0] self.books = args[1::] self.bo...
none
1
3.833121
4
projects/bugs/example2.py
shreystechtips/pythonbytes
2
6627129
<reponame>shreystechtips/pythonbytes # Same program as 'example.py' but fewer lines, some minor changes import turtle from turtle import Turtle turtle.bgcolor(.95, .91, .85) # conda Turtle uses floats from 0.0 to 1.0 for rgb values s, s2, epsilon, close_distance, a_cumulative, nCycles = 390., 390./2., 0.2, 0.21, 0...
# Same program as 'example.py' but fewer lines, some minor changes import turtle from turtle import Turtle turtle.bgcolor(.95, .91, .85) # conda Turtle uses floats from 0.0 to 1.0 for rgb values s, s2, epsilon, close_distance, a_cumulative, nCycles = 390., 390./2., 0.2, 0.21, 0., 0. def ni(i): return (i+1)%4 # ...
en
0.744654
# Same program as 'example.py' but fewer lines, some minor changes # conda Turtle uses floats from 0.0 to 1.0 for rgb values # ni is 'next index' in the square of bugs 0, 1, 2, 3 # a, b, c, d --> a[] we create a list of turtles to simplify the code # box > b
3.448307
3
lib/django-1.4/django/contrib/gis/db/backends/oracle/models.py
MiCHiLU/google_appengine_sdk
790
6627130
""" The GeometryColumns and SpatialRefSys models for the Oracle spatial backend. It should be noted that Oracle Spatial does not have database tables named according to the OGC standard, so the closest analogs are used. For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns model and the `SDO_...
""" The GeometryColumns and SpatialRefSys models for the Oracle spatial backend. It should be noted that Oracle Spatial does not have database tables named according to the OGC standard, so the closest analogs are used. For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns model and the `SDO_...
en
0.757492
The GeometryColumns and SpatialRefSys models for the Oracle spatial backend. It should be noted that Oracle Spatial does not have database tables named according to the OGC standard, so the closest analogs are used. For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns model and the `SDO_COORD...
2.398881
2
filters/oscillatory_hallucination/filter.py
raft001/NL-Augmenter
0
6627131
from collections import Counter from nltk import ngrams from transformers import BasicTokenizer from interfaces.SentenceOperation import SentenceAndTargetOperation from tasks.TaskTypes import TaskType class OscillatoryHallucinationFilter(SentenceAndTargetOperation): """N-gram Count based Heuristic for Detectin...
from collections import Counter from nltk import ngrams from transformers import BasicTokenizer from interfaces.SentenceOperation import SentenceAndTargetOperation from tasks.TaskTypes import TaskType class OscillatoryHallucinationFilter(SentenceAndTargetOperation): """N-gram Count based Heuristic for Detectin...
en
0.922208
N-gram Count based Heuristic for Detecting Oscillatory Hallucinations Paper: https://arxiv.org/pdf/2104.06683.pdf The paper did not explicitly tokenize since IWSLT is available in tokenized form. Tokenization used here = Whitespace + Punctuation, as in multilingual BERT pre-tokenization. Finally, one mo...
2.803286
3
OutputImageAsPNGs.py
w326004741/MNIST-Data-Set-Problem-Sheet
0
6627132
#import OutputImageToConsole, python imaging library, numpy import OutputImageToConsole as out import PIL.Image as pil import numpy as np #defined function def outImages(type): #set if loop if(type == 'test'): #using len() return the length of an object(char,list,tuple,etc.) or number of items f...
#import OutputImageToConsole, python imaging library, numpy import OutputImageToConsole as out import PIL.Image as pil import numpy as np #defined function def outImages(type): #set if loop if(type == 'test'): #using len() return the length of an object(char,list,tuple,etc.) or number of items f...
en
0.582738
#import OutputImageToConsole, python imaging library, numpy #defined function #set if loop #using len() return the length of an object(char,list,tuple,etc.) or number of items #Convert PIL image.img is a PIL image #convert RGB mode #save image as RGB mode and output specific file name. #save imgname #set if loop #using...
3.169237
3
sysinv/sysinv/sysinv/sysinv/puppet/dcdbsync.py
albailey/config
10
6627133
# # Copyright (c) 2019 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # from sysinv.common import constants from sysinv.common import utils from sysinv.helm import helm from sysinv.puppet import openstack class DCDBsyncPuppet(openstack.OpenstackBasePuppet): """Class to encapsulate puppet operat...
# # Copyright (c) 2019 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # from sysinv.common import constants from sysinv.common import utils from sysinv.helm import helm from sysinv.puppet import openstack class DCDBsyncPuppet(openstack.OpenstackBasePuppet): """Class to encapsulate puppet operat...
en
0.889716
# # Copyright (c) 2019 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # Class to encapsulate puppet operations for dcdbsync configuration # initial bootstrap is bound to localhost # The region in which the identity server can be found # The dcdbsync instance for openstack is authenticated with # ...
1.707929
2
napari/layers/utils/stack_utils.py
davidpross/napari
1
6627134
<reponame>davidpross/napari<filename>napari/layers/utils/stack_utils.py from __future__ import annotations import itertools from typing import TYPE_CHECKING, List import numpy as np from ...layers import Image from ...layers.image._image_utils import guess_multiscale from ...utils.colormaps import CYMRGB, MAGENTA_GR...
from __future__ import annotations import itertools from typing import TYPE_CHECKING, List import numpy as np from ...layers import Image from ...layers.image._image_utils import guess_multiscale from ...utils.colormaps import CYMRGB, MAGENTA_GREEN, Colormap from ...utils.misc import ensure_iterable, ensure_sequence...
en
0.727685
Take a single index slice from array using slicing. Equivalent to :func:`np.take`, but using slicing, which ensures that the output is a view of the original array. Parameters ---------- array : NumPy or other array Input array to be sliced. axis : int The axis along which to s...
2.604029
3
count_classes.py
DerekGloudemans/detrac-lbt
2
6627135
<gh_stars>1-10 import argparse import os,sys,inspect import numpy as np import random import time import math import _pickle as pickle random.seed = 0 import cv2 from PIL import Image import torch import matplotlib.pyplot as plt from config.data_paths import data_paths # detector_path = os.path.join(os.getcwd(),"...
import argparse import os,sys,inspect import numpy as np import random import time import math import _pickle as pickle random.seed = 0 import cv2 from PIL import Image import torch import matplotlib.pyplot as plt from config.data_paths import data_paths # detector_path = os.path.join(os.getcwd(),"models","pytorc...
en
0.669599
# detector_path = os.path.join(os.getcwd(),"models","pytorch_retinanet_detector") # sys.path.insert(0,detector_path) # get list of all files in directory and corresponding path to track and labels # get track_dict #tracks.reverse() #override tracks with a shorter list #tracks = [39761,40141,40213,40241,40963,40992,6352...
1.990465
2
Python/Nqueen.py
montukv/Coding-problem-solutions
0
6627136
<filename>Python/Nqueen.py def isSafe(board,x,y,n): for row in range(x): if(board[row][y] == 1): return False row = x col = y while(row>=0 and col>=0): if(board[row][col] == 1): return False row -= 1 col -= 1 row = x col = y w...
<filename>Python/Nqueen.py def isSafe(board,x,y,n): for row in range(x): if(board[row][y] == 1): return False row = x col = y while(row>=0 and col>=0): if(board[row][col] == 1): return False row -= 1 col -= 1 row = x col = y w...
none
1
3.674052
4
PycharmProjects/pythonteste/ex044.py
caioalexleme/Curso_Python
3
6627137
<filename>PycharmProjects/pythonteste/ex044.py valor = float(input('Qual o valor do produto? R$')) pagamento = int(input('''Qual a forma de pagamento? [1]À vista (dinheiro cheque) [2]À vista no cartão [3]Em até 2X no cartão [4]3X ou mais no cartão Digite aqui a opção: ''')) if pagamento == 1: print('Você ganhou 1...
<filename>PycharmProjects/pythonteste/ex044.py valor = float(input('Qual o valor do produto? R$')) pagamento = int(input('''Qual a forma de pagamento? [1]À vista (dinheiro cheque) [2]À vista no cartão [3]Em até 2X no cartão [4]3X ou mais no cartão Digite aqui a opção: ''')) if pagamento == 1: print('Você ganhou 1...
pt
0.985177
Qual a forma de pagamento? [1]À vista (dinheiro cheque) [2]À vista no cartão [3]Em até 2X no cartão [4]3X ou mais no cartão Digite aqui a opção:
4.017843
4
tensorflow_quantum/core/ops/math_ops/inner_product_op.py
amogh7joshi/quantum
1
6627138
# Copyright 2020 The TensorFlow Quantum 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...
# Copyright 2020 The TensorFlow Quantum 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...
en
0.669814
# Copyright 2020 The TensorFlow Quantum 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...
2.117136
2
run.py
abhilashmnair/weather-webhook
1
6627139
<filename>run.py from telegram import * from telegram.ext import * import requests import json token = 'YOUR_BOT_TOKEN' bot = Bot(token) updater = Updater(token,use_context=True) dispatcher : Dispatcher = updater.dispatcher def getWeatherData(city_name): key = 'OpenWeatherAPI_KEY' URL = f'https://...
<filename>run.py from telegram import * from telegram.ext import * import requests import json token = 'YOUR_BOT_TOKEN' bot = Bot(token) updater = Updater(token,use_context=True) dispatcher : Dispatcher = updater.dispatcher def getWeatherData(city_name): key = 'OpenWeatherAPI_KEY' URL = f'https://...
none
1
2.94703
3
Chapter03/chapter_03_example_03.py
pesader/hands-on-music-generation-with-magenta
0
6627140
""" This example shows a polyphonic generation with the performance rnn model. VERSION: Magenta 1.1.7 """ import math import os import time import magenta.music as mm import tensorflow as tf from magenta.models.performance_rnn import performance_sequence_generator from note_seq.protobuf.generator_pb2 import Generato...
""" This example shows a polyphonic generation with the performance rnn model. VERSION: Magenta 1.1.7 """ import math import os import time import magenta.music as mm import tensorflow as tf from magenta.models.performance_rnn import performance_sequence_generator from note_seq.protobuf.generator_pb2 import Generato...
en
0.847685
This example shows a polyphonic generation with the performance rnn model. VERSION: Magenta 1.1.7 Generates and returns a new sequence given the sequence generator. Uses the bundle name to download the bundle in the "bundles" directory if it doesn't already exist, then uses the sequence generator and the gene...
2.842292
3
January/Day6-Car-Pooling.py
tayyrov/Daily_Coding_Challenge
1
6627141
""" Question Source: https://leetcode.com/problems/car-pooling/ Level: Medium Topic: Sorting, stimulation Solver: Tayyrov Date: 01.06.2022 """ from typing import * def carPooling(trips: List[List[int]], capacity: int) -> bool: passenger_logistics = [] for nums_pass, add, remove in trips: ...
""" Question Source: https://leetcode.com/problems/car-pooling/ Level: Medium Topic: Sorting, stimulation Solver: Tayyrov Date: 01.06.2022 """ from typing import * def carPooling(trips: List[List[int]], capacity: int) -> bool: passenger_logistics = [] for nums_pass, add, remove in trips: ...
en
0.793115
Question Source: https://leetcode.com/problems/car-pooling/ Level: Medium Topic: Sorting, stimulation Solver: Tayyrov Date: 01.06.2022 # minus comes before plus, meaning after sorting first we remove then we add. # print(passenger_logistics) [[2,1,5],[3,5,7]] => [(1, 2), (5, -2), (5, 3), (7, -3)]
3.831848
4
python/pyspark/ml/param/_shared_params_code_gen.py
dobashim/spark
0
6627142
<reponame>dobashim/spark # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
en
0.744116
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
1.67705
2
models/1-Tom/train/kaggle-hubmap-main/src/02_train/run.py
navekshasood/HuBMAP---Hacking-the-Kidney
0
6627143
import time import pandas as pd import numpy as np import gc from os.path import join as opj import matplotlib.pyplot as plt import pickle from tqdm import tqdm import torchvision import torch from torch import nn, optim from torch.utils.data import DataLoader from dataset import HuBMAPDatasetTrain from models import b...
import time import pandas as pd import numpy as np import gc from os.path import join as opj import matplotlib.pyplot as plt import pickle from tqdm import tqdm import torchvision import torch from torch import nn, optim from torch.utils.data import DataLoader from dataset import HuBMAPDatasetTrain from models import b...
en
0.356694
Imshow for Tensor. # mean = np.array([0.5, 0.5, 0.5]) # std = np.array([0.5, 0.5, 0.5]) # inp = STD * inp + MEAN # pause a bit so that plots are updated #dataset #add pseudo label # dataloader #model # if pretrain_path_list is not None: # model.load_state_dict(torch.load(pretrain_path_list[fold])) # print("pre-...
1.894844
2
tests/components/hue/conftest.py
bazwilliams/home-assistant
1
6627144
"""Test helpers for Hue.""" from collections import deque import logging from unittest.mock import AsyncMock, Mock, patch from aiohue.groups import Groups from aiohue.lights import Lights from aiohue.scenes import Scenes from aiohue.sensors import Sensors import pytest from homeassistant.components import hue from ho...
"""Test helpers for Hue.""" from collections import deque import logging from unittest.mock import AsyncMock, Mock, patch from aiohue.groups import Groups from aiohue.lights import Lights from aiohue.scenes import Scenes from aiohue.sensors import Sensors import pytest from homeassistant.components import hue from ho...
en
0.86199
Test helpers for Hue. # noqa: F401 Make the request refresh delay 0 for instant tests. Create a mock Hue bridge. Mock the Hue api. Create a mock API. Mock a Hue bridge. Load the Hue platform with the provided bridge for sensor-related platforms. # simulate a full setup by manually adding the bridge config entry # and m...
2.352766
2
mlir/test/python/dialects/linalg/opdsl/emit_structured_generic.py
acidburn0zzz/llvm-project
2,338
6627145
<reponame>acidburn0zzz/llvm-project<filename>mlir/test/python/dialects/linalg/opdsl/emit_structured_generic.py<gh_stars>1000+ # RUN: %PYTHON %s | FileCheck %s from mlir.ir import * from mlir.dialects import builtin from mlir.dialects import linalg from mlir.dialects import std from mlir.dialects.linalg.opdsl.lang imp...
# RUN: %PYTHON %s | FileCheck %s from mlir.ir import * from mlir.dialects import builtin from mlir.dialects import linalg from mlir.dialects import std from mlir.dialects.linalg.opdsl.lang import * T1 = TV.T1 T2 = TV.T2 @linalg_structured_op def matmul_mono( A=TensorDef(T, S.M, S.K), B=TensorDef(T, S.K, S....
en
0.30148
# RUN: %PYTHON %s | FileCheck %s # Multiplication indexing maps. We verify only the indexing maps of the # first multiplication and then do additional tests on casting and body # generation behavior. # CHECK: #[[$MUL_MAP_A:.+]] = affine_map<(d0, d1, d2) -> (d0, d2)> # CHECK: #[[$MUL_MAP_B:.+]] = affine_map<(d0, d1, d2)...
2.016758
2
dlfairness/original_code/Balanced-Datasets-Are-Not-Enough/object_multilabel/adv/ae_adv_model.py
lin-tan/fairness-variance
0
6627146
import torch import torch.nn as nn import functools import torch.nn.functional as F import torchvision.models as models import torch.nn.utils from torch.autograd import Function import copy def get_norm_layer(norm_type='instance'): if norm_type == 'batch': norm_layer = functools.partial(nn.Bat...
import torch import torch.nn as nn import functools import torch.nn.functional as F import torchvision.models as models import torch.nn.utils from torch.autograd import Function import copy def get_norm_layer(norm_type='instance'): if norm_type == 'batch': norm_layer = functools.partial(nn.Bat...
en
0.524742
# with skip connection and pixel connection and smoothed # construct unet structure ## initialize bias # assume input image size = 224 # (ngf, 112, 112) # (ngf*2, 56, 56) # (ngf*4, 28, 28) # (ngf*8, 14, 14) # (ngf*8, 7, 7) # (ngf*8, 14, 14) # (ngf*4, 28, 28) # (ngf*2, 56, 56) # (ngf, 112, 112) # (3, 224, 224)
2.478694
2
tools/accuracy_checker/setup.py
jkamelin/open_model_zoo
2
6627147
""" Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
""" Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
en
0.742924
Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
1.672402
2
protobuf-master/python/google/protobuf/internal/text_format_test.py
Fresher-Chen/tarsim
0
6627148
<reponame>Fresher-Chen/tarsim #! /usr/bin/env python # -*- coding: utf-8 -*- # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification,...
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that t...
en
0.781157
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that t...
1.620763
2
ambari-server/src/main/resources/stacks/ADH/1.5/services/HIVE/package/scripts/hive_server_interactive.py
kuhella/ambari
0
6627149
<gh_stars>0 #!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the...
#!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License");...
en
0.779058
#!/usr/bin/env python Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you...
1.327337
1
rayml/pipelines/components/estimators/classifiers/vowpal_wabbit_classifiers.py
gcode-ai/rayml
0
6627150
"""Vowpal Wabbit Classifiers.""" from abc import abstractmethod from skopt.space import Integer, Real from rayml.model_family import ModelFamily from rayml.pipelines.components.estimators import Estimator from rayml.problem_types import ProblemTypes from rayml.utils.gen_utils import import_or_raise class VowpalWabb...
"""Vowpal Wabbit Classifiers.""" from abc import abstractmethod from skopt.space import Integer, Real from rayml.model_family import ModelFamily from rayml.pipelines.components.estimators import Estimator from rayml.problem_types import ProblemTypes from rayml.utils.gen_utils import import_or_raise class VowpalWabb...
en
0.647025
Vowpal Wabbit Classifiers. Vowpal Wabbit Base Classifier. Args: loss_function (str): Specifies the loss function to use. One of {"squared", "classic", "hinge", "logistic", "quantile"}. Defaults to "logistic". learning_rate (float): Boosting learning rate. Defaults to 0.5. decay_learning_rat...
2.48788
2