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
scripts/vhdl_gen.py
tpcorrea/hdltools
0
6622251
<filename>scripts/vhdl_gen.py ################################################################################# # Copyright 2020 <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 ...
<filename>scripts/vhdl_gen.py ################################################################################# # Copyright 2020 <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 ...
en
0.603935
################################################################################# # Copyright 2020 <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/LIC...
2.405687
2
cli_taxo.py
ali5ter/cli_taxo
6
6622252
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # Parse CLI help and pretty print command taxonomy # @author <NAME> <<EMAIL>> from __future__ import print_function import sys import os import getopt import subprocess from colorama import Fore, Back, Style import string import re from enum import Enum from...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Parse CLI help and pretty print command taxonomy # @author <NAME> <<EMAIL>> from __future__ import print_function import sys import os import getopt import subprocess from colorama import Fore, Back, Style import string import re from enum import Enum from collections im...
en
0.561526
#!/usr/bin/env python # -*- coding: utf-8 -*- # Parse CLI help and pretty print command taxonomy # @author <NAME> <<EMAIL>> # If usage description returned is a man page, make sure it # - returned with out a pager # - returned with no formatting control chars #)\S+)\s+[A-Z]' \\") # Docker shell completion\\nsource '$HO...
2.422898
2
sei_py/base/__init__.py
xh4zr/sei_py
1
6622253
from sei_py.base.page import Page from sei_py.base.providers import UrlProvider from sei_py.base.exception import SeiException
from sei_py.base.page import Page from sei_py.base.providers import UrlProvider from sei_py.base.exception import SeiException
none
1
1.145393
1
datahub/dbmaintenance/test/commands/test_update_order_sector.py
Staberinde/data-hub-api
6
6622254
from io import BytesIO import factory import pytest from django.core.management import call_command from reversion.models import Version from datahub.metadata.test.factories import SectorFactory from datahub.omis.order.test.factories import OrderFactory pytestmark = pytest.mark.django_db def test_happy_path(s3_stu...
from io import BytesIO import factory import pytest from django.core.management import call_command from reversion.models import Version from datahub.metadata.test.factories import SectorFactory from datahub.omis.order.test.factories import OrderFactory pytestmark = pytest.mark.django_db def test_happy_path(s3_stu...
en
0.260559
Test that the command updates the specified records. id,old_sector_id,new_sector_id {orders[0].pk},{old_sectors[0].pk},{new_sectors[0].pk} {orders[1].pk},{old_sectors[1].pk},{new_sectors[1].pk} {orders[2].pk},{old_sectors[2].pk},{new_sectors[2].pk} Test that the command logs an error when the order PK does not exist. i...
1.987566
2
enthought/mayavi/tools/probe_data.py
enthought/etsproxy
3
6622255
<filename>enthought/mayavi/tools/probe_data.py # proxy module from __future__ import absolute_import from mayavi.tools.probe_data import *
<filename>enthought/mayavi/tools/probe_data.py # proxy module from __future__ import absolute_import from mayavi.tools.probe_data import *
es
0.125187
# proxy module
1.000334
1
src/extra/urls.py
LokotamaTheMastermind/website-portfolio-django-project
0
6622256
from django.urls import path from .views import * app_name = 'policies' urlpatterns = [ path('privacy/', privacy, name='privacy-policy'), path('terms-conditions/', terms_conditions, name='terms-and-conditions') ]
from django.urls import path from .views import * app_name = 'policies' urlpatterns = [ path('privacy/', privacy, name='privacy-policy'), path('terms-conditions/', terms_conditions, name='terms-and-conditions') ]
none
1
1.536335
2
docs/components_page/components/index/simple.py
glsdown/dash-bootstrap-components
776
6622257
# 1. Import Dash import dash import dash_bootstrap_components as dbc # 2. Create a Dash app instance app = dash.Dash(external_stylesheets=[dbc.themes.BOOTSTRAP]) # 3. Add the example to the app's layout # First we copy the snippet from the docs badge = dbc.Button( [ "Notifications", dbc.Badge("4",...
# 1. Import Dash import dash import dash_bootstrap_components as dbc # 2. Create a Dash app instance app = dash.Dash(external_stylesheets=[dbc.themes.BOOTSTRAP]) # 3. Add the example to the app's layout # First we copy the snippet from the docs badge = dbc.Button( [ "Notifications", dbc.Badge("4",...
en
0.731728
# 1. Import Dash # 2. Create a Dash app instance # 3. Add the example to the app's layout # First we copy the snippet from the docs # Then we incorporate the snippet into our layout. # This example keeps it simple and just wraps it in a Container # 5. Start the Dash server
2.900667
3
jira_pert/model/cycle_detector_dfs.py
unitatem/jira-pert
0
6622258
from jira_pert.model.pert_graph import PertGraph class CycleDetectorDFS(object): def __init__(self, graph: PertGraph): self._graph = graph self._cycle = [] def is_cyclic(self): self._cycle = [] visited = dict() recursion_stack = dict() for key in self._graph.g...
from jira_pert.model.pert_graph import PertGraph class CycleDetectorDFS(object): def __init__(self, graph: PertGraph): self._graph = graph self._cycle = [] def is_cyclic(self): self._cycle = [] visited = dict() recursion_stack = dict() for key in self._graph.g...
none
1
2.700523
3
core-python/Core_Python/stackoverflow/UniqueRandomNameList.py
theumang100/tutorials-1
9
6622259
<filename>core-python/Core_Python/stackoverflow/UniqueRandomNameList.py import random print("Random Name Picker") input_string = input("Input names: ") if input_string == "exit": exit() name_list = input_string.split() print("Our contestants for this round are:", name_list) s = int(input("Enter a Positive Sample ...
<filename>core-python/Core_Python/stackoverflow/UniqueRandomNameList.py import random print("Random Name Picker") input_string = input("Input names: ") if input_string == "exit": exit() name_list = input_string.split() print("Our contestants for this round are:", name_list) s = int(input("Enter a Positive Sample ...
none
1
3.600216
4
app.py
dreamInCoDeforlife/AWSHackathon
2
6622260
<gh_stars>1-10 import hashlib import json from time import time from urllib.parse import urlparse from uuid import uuid4 from flask_cors import CORS import requests from flask import Flask, jsonify, request import boto3 import ast import decimal from boto3.dynamodb.conditions import Key, Attr from botocore.exceptions i...
import hashlib import json from time import time from urllib.parse import urlparse from uuid import uuid4 from flask_cors import CORS import requests from flask import Flask, jsonify, request import boto3 import ast import decimal from boto3.dynamodb.conditions import Key, Attr from botocore.exceptions import ClientErr...
en
0.354635
<form method=POST enctype=multipart/form-data action="upload"> <input type=file name=myfile> <input type=submit> </form> # s3.Bucket('thirdparty-image-bucket').put_object(new_uuid+"/") # values = ast.literal_eval(dict_str) # todo # s3.Bucket('thirdparty-image-bucket').delete_key(key) # id_ = uuid4() # print(file....
1.726069
2
examples/get_suggestions.py
pranavgupta1234/ptrie
0
6622261
<reponame>pranavgupta1234/ptrie import os, sys sys.path.insert(0, os.path.join(os.getcwd(), "../pythontrie/")) from pythontrie import trie if __name__ == '__main__': sample_trie = trie() sample_strings = ['heyy', 'heyay', 'heyey', 'hyyy', 'yoyo', 'heeyy', 'hoeyy'] for sample_string in sample_strings: ...
import os, sys sys.path.insert(0, os.path.join(os.getcwd(), "../pythontrie/")) from pythontrie import trie if __name__ == '__main__': sample_trie = trie() sample_strings = ['heyy', 'heyay', 'heyey', 'hyyy', 'yoyo', 'heeyy', 'hoeyy'] for sample_string in sample_strings: sample_trie.insert(sampl...
none
1
2.54036
3
deltalanguage/test/test_real_node.py
riverlane/deltalanguage
16
6622262
<gh_stars>10-100 from collections import OrderedDict import unittest import numpy as np from deltalanguage.wiring import RealNode, PyConstBody, DeltaGraph, InPort class RealNodeEq(unittest.TestCase): """Tests for the definition of equality over real nodes. """ def test_eq(self): g1 = DeltaGraph...
from collections import OrderedDict import unittest import numpy as np from deltalanguage.wiring import RealNode, PyConstBody, DeltaGraph, InPort class RealNodeEq(unittest.TestCase): """Tests for the definition of equality over real nodes. """ def test_eq(self): g1 = DeltaGraph() b1 = P...
en
0.902673
Tests for the definition of equality over real nodes. Test the behaviour of adding out ports to a real node. Ensure that no matter what order out ports are added, they end up in the order specified in outputs. This property needs to hold even when not all ports are added. # Add all ports in random order...
2.886222
3
scripts/download_calipso_data.py
lucien-sim/cloudsat-viz
1
6622263
#!/usr/bin/python3 import os def download_ftp_calipso(ftp_url, dest_path): """Downloads the specified files via FTP. PARAMETERS: ----------- ftp_url: FTP address for directory that contains all the CALIPSO files dest_path: Path to directory to which the CALIPSO files will ...
#!/usr/bin/python3 import os def download_ftp_calipso(ftp_url, dest_path): """Downloads the specified files via FTP. PARAMETERS: ----------- ftp_url: FTP address for directory that contains all the CALIPSO files dest_path: Path to directory to which the CALIPSO files will ...
en
0.799905
#!/usr/bin/python3 Downloads the specified files via FTP. PARAMETERS: ----------- ftp_url: FTP address for directory that contains all the CALIPSO files dest_path: Path to directory to which the CALIPSO files will be saved. OUTPUTS: -------- None Before the downlo...
3.747019
4
solutions/Ugly Number/solution.py
nilax97/leetcode-solutions
3
6622264
<reponame>nilax97/leetcode-solutions class Solution: def isUgly(self, num: int) -> bool: def ugly(num): if num <=0: return False if abs(num)<2: return True if num == 2 or num == 3 or num == 5: return True if num ...
class Solution: def isUgly(self, num: int) -> bool: def ugly(num): if num <=0: return False if abs(num)<2: return True if num == 2 or num == 3 or num == 5: return True if num % 2 == 0: return ugly...
none
1
3.704461
4
urlcf/service.py
alkorgun/urlcf
1
6622265
<gh_stars>1-10 """ Created on Jul 5, 2017 @author: alkorgun """ import os import sys from .wsgi import app class UrlcfService(object): pid_file = "/var/run/urlcf-service.pid" default_pipe = "/dev/null" default_folder = "/tmp" def daemonize(self): # by <NAME> """ UNIX double-fork ...
""" Created on Jul 5, 2017 @author: alkorgun """ import os import sys from .wsgi import app class UrlcfService(object): pid_file = "/var/run/urlcf-service.pid" default_pipe = "/dev/null" default_folder = "/tmp" def daemonize(self): # by <NAME> """ UNIX double-fork magic. ...
en
0.734263
Created on Jul 5, 2017 @author: alkorgun # by <NAME> UNIX double-fork magic.
2.312815
2
fimath/geodesic.py
kalinkinisaac/modular
0
6622266
<gh_stars>0 from .field import Field from .re_field import ReField from .bases import BaseGeodesic class Geodesic(BaseGeodesic): __slots__ = ('_begin', '_end', '_left', '_right', '_top', '_bot', '_is_vertical', '_vertical_x', '_has_inf', '_center', '_sq_radius') def __new__(cls, begin, end)...
from .field import Field from .re_field import ReField from .bases import BaseGeodesic class Geodesic(BaseGeodesic): __slots__ = ('_begin', '_end', '_left', '_right', '_top', '_bot', '_is_vertical', '_vertical_x', '_has_inf', '_center', '_sq_radius') def __new__(cls, begin, end): s...
none
1
2.440275
2
downloader.py
Starlord713/pynstaScraper
0
6622267
from selenium.webdriver.common import by as find from urllib.error import HTTPError import time as t import os from urllib import request import csv class Link: def __init__(self, src, status): self.src = src self.status = status def downloader(cdriverf, finder, directory): find_a_term = find...
from selenium.webdriver.common import by as find from urllib.error import HTTPError import time as t import os from urllib import request import csv class Link: def __init__(self, src, status): self.src = src self.status = status def downloader(cdriverf, finder, directory): find_a_term = find...
en
0.546886
#load state if exists #save the state before download the images #downloading the images
3.039592
3
LLE_C.py
bobchengyang/SDP_RUN
0
6622268
<gh_stars>0 import torch import torch.nn as nn from torch.autograd import Variable def LLE_C(feature,\ b_ind,\ lalel,\ n_feature,\ LLE_C_vec,\ n_train,\ metric_M_step,\ LLE_st,\ optimizer_LLE): tril_idx=torch.tril_indices(n_train,...
import torch import torch.nn as nn from torch.autograd import Variable def LLE_C(feature,\ b_ind,\ lalel,\ n_feature,\ LLE_C_vec,\ n_train,\ metric_M_step,\ LLE_st,\ optimizer_LLE): tril_idx=torch.tril_indices(n_train,n_train,-1) ...
none
1
2.335695
2
scr/iou.py
DeepsMoseli/DetectronCheck
0
6622269
<gh_stars>0 import numpy as np class intersection_over_Union: def get_area(self,sq): length = (sq[1]-sq[0]) width = (sq[3]-sq[2]) area = length*width return area def intersaction(self,sq1,sq2): xs = [] ys = [] inter = [] if sq1[1]>=sq2[0] o...
import numpy as np class intersection_over_Union: def get_area(self,sq): length = (sq[1]-sq[0]) width = (sq[3]-sq[2]) area = length*width return area def intersaction(self,sq1,sq2): xs = [] ys = [] inter = [] if sq1[1]>=sq2[0] or sq1[0]>=sq...
en
0.16942
#print("area1: ", a1) #print("area2: ", a2) #print("area inter: ", inter)
3.481265
3
colassigner/__init__.py
endremborza/colassigner
0
6622270
# flake8: noqa from ._version import __version__ from .core import ChildColAssigner, ColAccessor, ColAssigner from .meta_base import get_all_cols, get_att_value from .type_hinting import Col from .util import camel_to_snake
# flake8: noqa from ._version import __version__ from .core import ChildColAssigner, ColAccessor, ColAssigner from .meta_base import get_all_cols, get_att_value from .type_hinting import Col from .util import camel_to_snake
it
0.238973
# flake8: noqa
1.158649
1
dazeus/__init__.py
dazeus/dazeus-python
1
6622271
from .scope import Scope from .dazeus import DaZeus
from .scope import Scope from .dazeus import DaZeus
none
1
1.050658
1
main.py
ayushbasak/AmazonPriceTracker
0
6622272
<reponame>ayushbasak/AmazonPriceTracker<gh_stars>0 import PriceTracker as pt import time # Insert the Amazon Link and header (User-Agent) to Track # For more info lookup the README urls = [] with open("data.txt","r") as f: for line in f.readlines(): urls.append(line.rstrip("\n")) header = {"User-Age...
import PriceTracker as pt import time # Insert the Amazon Link and header (User-Agent) to Track # For more info lookup the README urls = [] with open("data.txt","r") as f: for line in f.readlines(): urls.append(line.rstrip("\n")) header = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:7...
en
0.745635
# Insert the Amazon Link and header (User-Agent) to Track # For more info lookup the README
2.79637
3
gpflow/utilities/bijectors.py
akhayes/GPflow
0
6622273
<reponame>akhayes/GPflow from typing import Optional import tensorflow_probability as tfp from .. import config from .utilities import to_default_float __all__ = ["positive", "triangular"] def positive(lower: Optional[float] = None): lower_value = config.default_positive_minimum() if lower_value is None: ...
from typing import Optional import tensorflow_probability as tfp from .. import config from .utilities import to_default_float __all__ = ["positive", "triangular"] def positive(lower: Optional[float] = None): lower_value = config.default_positive_minimum() if lower_value is None: return tfp.bijecto...
none
1
2.405277
2
tests/orthanc/test_orthanc_instance_post.py
gacou54/pyorthanc
12
6622274
# coding: utf-8 # author: <NAME> import unittest import requests from pyorthanc import Orthanc from tests import setup_server class TestOrthancInstancePosts(unittest.TestCase): @classmethod def setUpClass(cls) -> None: global orthanc_subprocess orthanc_subprocess = setup_server.setup_orthan...
# coding: utf-8 # author: <NAME> import unittest import requests from pyorthanc import Orthanc from tests import setup_server class TestOrthancInstancePosts(unittest.TestCase): @classmethod def setUpClass(cls) -> None: global orthanc_subprocess orthanc_subprocess = setup_server.setup_orthan...
en
0.824763
# coding: utf-8 # author: <NAME>
2.473828
2
GenerativeModels/utils/test_utils.py
ariel415el/PerceptualLossGLO-Pytorch
0
6622275
import os import numpy as np import torch from tqdm import tqdm from GenerativeModels.utils.data_utils import get_dataloader from GenerativeModels.utils.fid_scroe.fid_score import calculate_frechet_distance from GenerativeModels.utils.fid_scroe.inception import InceptionV3 from losses.swd.patch_swd import compute_swd...
import os import numpy as np import torch from tqdm import tqdm from GenerativeModels.utils.data_utils import get_dataloader from GenerativeModels.utils.fid_scroe.fid_score import calculate_frechet_distance from GenerativeModels.utils.fid_scroe.inception import InceptionV3 from losses.swd.patch_swd import compute_swd...
en
0.82521
Compute The FID score of the train, GLO, IMLE and reconstructed images distribution compared to the test distribution # Computing Inception activations # get activations for real images from test set # get activations for real images from train set # get activations for reconstructed images # get activations for g...
2.093657
2
frappe-bench/env/lib/python2.7/site-packages/num2words/lang_PL.py
ibrahmm22/library-management
0
6622276
# -*- encoding: utf-8 -*- # Copyright (c) 2003, <NAME>. All Rights Reserved. # Copyright (c) 2013, Savoir-faire Linux inc. All Rights Reserved. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foun...
# -*- encoding: utf-8 -*- # Copyright (c) 2003, <NAME>. All Rights Reserved. # Copyright (c) 2013, Savoir-faire Linux inc. All Rights Reserved. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foun...
pl
0.829935
# -*- encoding: utf-8 -*- # Copyright (c) 2003, <NAME>. All Rights Reserved. # Copyright (c) 2013, Savoir-faire Linux inc. All Rights Reserved. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Found...
2.803401
3
pants-completion.py
hythloday/pants
0
6622277
#!/usr/bin/env python # goals=./pants goal goals | egrep -o -- '^ +([a-z-]+):' | egrep -o -- '[a-z-]+' # # for goal in $goals; do # echo $goal # ./pants goal $goal --help | egrep -o -- '--([a-z-]+)' > $goal.options # done import os for options in [ o for o in os.listdir('.') if o.endswith('options') ]: goal =...
#!/usr/bin/env python # goals=./pants goal goals | egrep -o -- '^ +([a-z-]+):' | egrep -o -- '[a-z-]+' # # for goal in $goals; do # echo $goal # ./pants goal $goal --help | egrep -o -- '--([a-z-]+)' > $goal.options # done import os for options in [ o for o in os.listdir('.') if o.endswith('options') ]: goal =...
en
0.328978
#!/usr/bin/env python # goals=./pants goal goals | egrep -o -- '^ +([a-z-]+):' | egrep -o -- '[a-z-]+' # # for goal in $goals; do # echo $goal # ./pants goal $goal --help | egrep -o -- '--([a-z-]+)' > $goal.options # done %s) local opts='%s' __comp "$opts" ;; # rm *.options
2.71268
3
esmvalcore/experimental/recipe.py
markelg/ESMValCore
26
6622278
"""Recipe metadata.""" import logging import os import pprint import shutil from pathlib import Path from typing import Dict, Optional import yaml from esmvalcore._recipe import Recipe as RecipeEngine from esmvalcore.experimental.config import Session from . import CFG from ._logging import log_to_dir from .recipe_...
"""Recipe metadata.""" import logging import os import pprint import shutil from pathlib import Path from typing import Dict, Optional import yaml from esmvalcore._recipe import Recipe as RecipeEngine from esmvalcore.experimental.config import Session from . import CFG from ._logging import log_to_dir from .recipe_...
en
0.637812
Recipe metadata. API wrapper for the esmvalcore Recipe object. This class can be used to inspect and run the recipe. Parameters ---------- path : pathlike Path to the recipe. Return canonical string representation. Return string representation. Return html representation. Render output as html...
2.222687
2
visualDet3D/utils/visualize_utils.py
saurav1869/saurav1869-mono3d_road
0
6622279
<gh_stars>0 import cv2 import numpy as np import sys import torch from torch.utils.data import DataLoader sys.path.append("../") from visualDet3D.networks.utils import BackProjection, BBox3dProjector from visualDet3D.data.kitti.dataset import mono_dataset from visualDet3D.utils.utils import cfg_from_file from visual...
import cv2 import numpy as np import sys import torch from torch.utils.data import DataLoader sys.path.append("../") from visualDet3D.networks.utils import BackProjection, BBox3dProjector from visualDet3D.data.kitti.dataset import mono_dataset from visualDet3D.utils.utils import cfg_from_file from visualDet3D.utils....
en
0.712094
params: anchors = np.ndarray(N, 4) # (x, y, w, l) return: bboxes = np.ndarray(N, 4) # (x1, y1, x2, y2) # mean_x = bbox_3d_state_3d[:, 0].mean() # mean_z = bbox_3d_state_3d[:, 2].mean() # w, h, l, y, z, x, yaw = bbox # manually take a negative s. t. it's a right-hand # system, with # x facing in th...
2.282977
2
api/api.py
michaelDomingues/medinfore
0
6622280
#!/usr/bin/env python3 import fnmatch import logging import os from distutils.util import strtobool import re from flask import Flask, jsonify, make_response, request, abort from enigma.indexer import Indexer logging.basicConfig(format='%(asctime)s : %(module)s: %(levelname)s : %(message)s', level=logging.DEBUG) in...
#!/usr/bin/env python3 import fnmatch import logging import os from distutils.util import strtobool import re from flask import Flask, jsonify, make_response, request, abort from enigma.indexer import Indexer logging.basicConfig(format='%(asctime)s : %(module)s: %(levelname)s : %(message)s', level=logging.DEBUG) in...
en
0.476402
#!/usr/bin/env python3 # transform glob patterns to regular expressions
2.152947
2
Alignment/MuonAlignment/test/MuonGeometryArrange.py
malbouis/cmssw
0
6622281
<gh_stars>0 import FWCore.ParameterSet.Config as cms process =cms.Process("TEST") #Ideal geometry process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load('Configuration.Geometry.GeometryExtended2021_cff') process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi") process.load("Configur...
import FWCore.ParameterSet.Config as cms process =cms.Process("TEST") #Ideal geometry process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load('Configuration.Geometry.GeometryExtended2021_cff') process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi") process.load("Configuration.Standa...
en
0.378811
#Ideal geometry # Full configuration for Muon Geometry Comparison Tool #process.MuonGeometryCompare = cms.EDFilter("MuonGeometryArrange", # Root input files are not used yet. # Geometries are read from xml files # inputXMLCurrent = cms.untracked.string('B.xml'), # inputXMLCurrent = cms.untracked.string('A.xml')...
1.247091
1
statzcw/zvariance.py
ZCW-Data1dot2/python-basic-stats-derek-johns
0
6622282
from statzcw import zmean, zcount def variance(in_list): """ Finds variance of given list :param in_list: list of values :return: float rounded to 5 decimal places """ n = zcount.count(in_list) mean = zmean.mean(in_list) d = [(x - mean) ** 2 for x in in_list] v = sum(d) / (n - 1) ...
from statzcw import zmean, zcount def variance(in_list): """ Finds variance of given list :param in_list: list of values :return: float rounded to 5 decimal places """ n = zcount.count(in_list) mean = zmean.mean(in_list) d = [(x - mean) ** 2 for x in in_list] v = sum(d) / (n - 1) ...
en
0.400596
Finds variance of given list :param in_list: list of values :return: float rounded to 5 decimal places
3.45738
3
vad_service/src/VadService.py
blues-lab/passive-listening-prototype
0
6622283
import tempfile from pathlib import Path import grpc from sclog import getLogger from plp.proto import Vad_pb2 from plp.proto import Vad_pb2_grpc from vad import file_has_speech logger = getLogger(__name__) CLASSIFICATION_SERVICE_PORT = 50059 def save_bytes_as_tmp_wav_file(b: bytes) -> str: """ Save the g...
import tempfile from pathlib import Path import grpc from sclog import getLogger from plp.proto import Vad_pb2 from plp.proto import Vad_pb2_grpc from vad import file_has_speech logger = getLogger(__name__) CLASSIFICATION_SERVICE_PORT = 50059 def save_bytes_as_tmp_wav_file(b: bytes) -> str: """ Save the g...
en
0.861384
Save the given bytes to a file in a new temporary directory and return that file's path
2.664756
3
models/Account.py
devArtoria/Python-BlockChain
0
6622284
from mongoengine import * import datetime connect('PyCoin') class Accounts(Document): account_id = StringField( required=True ) timestamp = DateTimeField( default=datetime.datetime.now, required=True ) transactions = ListField( ) amount = LongField( def...
from mongoengine import * import datetime connect('PyCoin') class Accounts(Document): account_id = StringField( required=True ) timestamp = DateTimeField( default=datetime.datetime.now, required=True ) transactions = ListField( ) amount = LongField( def...
none
1
2.496771
2
dator.py
bismuthfoundation/stator
3
6622285
<gh_stars>1-10 import json from bismuthclient.rpcconnections import Connection from diff_simple import difficulty import psutil class Socket: def __init__(self): self.connect() def connect(self): try: self.connection = Connection(("127.0.0.1", 5658)) except: ra...
import json from bismuthclient.rpcconnections import Connection from diff_simple import difficulty import psutil class Socket: def __init__(self): self.connect() def connect(self): try: self.connection = Connection(("127.0.0.1", 5658)) except: raise def ge...
en
0.787136
# non-chartable instants # chartable instants # non-instants saves status calls and the last block range call # last block # difficulty # number is negative # number is negative # /difficulty
2.887814
3
tests/test_multirev_solvers.py
jorgepiloto/lamberthub
10
6622286
<filename>tests/test_multirev_solvers.py """ A collection of tests only for multi-revolution solvers """ import numpy as np import pytest from numpy.testing import assert_allclose from lamberthub import MULTI_REV_SOLVERS TABLE_OF_TRANSFERS = { "M1_prograde_high": [ np.array([0.50335770, 0.61869408, -1.5...
<filename>tests/test_multirev_solvers.py """ A collection of tests only for multi-revolution solvers """ import numpy as np import pytest from numpy.testing import assert_allclose from lamberthub import MULTI_REV_SOLVERS TABLE_OF_TRANSFERS = { "M1_prograde_high": [ np.array([0.50335770, 0.61869408, -1.5...
en
0.809953
A collection of tests only for multi-revolution solvers # [km / s] # [km / s] # [km / s] # [km / s] # [km / s] # [km / s] # [km / s] # [km / s] Directly taken from example 1 from The Superior Lambert Algorithm (Der Astrodynamics), by <NAME>, see https://amostech.com/TechnicalPapers/2011/Poster/DER.pdf # Initial condit...
2.071424
2
venv/lib/python3.7/sre_compile.py
OseiasBeu/PyECom
1
6622287
<reponame>OseiasBeu/PyECom /home/oseiasbeu/anaconda3/lib/python3.7/sre_compile.py
/home/oseiasbeu/anaconda3/lib/python3.7/sre_compile.py
none
1
0.910978
1
Udemy/Secao5/aula134/aula133.py
rafaelgama/Curso_Python
1
6622288
<reponame>rafaelgama/Curso_Python<gh_stars>1-10 # Web Scraping com Python. # instalar os pacotes: pip install requests e beautifulsoup4 import requests # parar fazer as requisições from bs4 import BeautifulSoup # Para permitir manipular o html. url = 'https://pt.stackoverflow.com/questions/tagged/python' # pegar a r...
# Web Scraping com Python. # instalar os pacotes: pip install requests e beautifulsoup4 import requests # parar fazer as requisições from bs4 import BeautifulSoup # Para permitir manipular o html. url = 'https://pt.stackoverflow.com/questions/tagged/python' # pegar a respota do request response = requests.get(url) #...
pt
0.694303
# Web Scraping com Python. # instalar os pacotes: pip install requests e beautifulsoup4 # parar fazer as requisições # Para permitir manipular o html. # pegar a respota do request #print(response.text) # mostra o html da pagina # Analisar o HTML e disponibilizar o Objeto # select() = seletor CSS do BeautifulSoup # sele...
3.746795
4
Concept/Sand_Box.py
Ahmad-Fahad/Python
0
6622289
for i in range(2,150, 4): print("{}-{}, ". format(i, i+1), end='' ) print() for i in range(4,150, 4): print("{}-{}, ". format(i, i+1), end='' ) """ lst_1 = [1,2,3] lst_2 = [9,4,5,6] for i in range(len(lst_2)): if lst_2[i]>5: lst_2[i]=0 print(lst_2) lst_3 = [lst_1]+[lst_2] print(list(zip(*lst_3))) A = ...
for i in range(2,150, 4): print("{}-{}, ". format(i, i+1), end='' ) print() for i in range(4,150, 4): print("{}-{}, ". format(i, i+1), end='' ) """ lst_1 = [1,2,3] lst_2 = [9,4,5,6] for i in range(len(lst_2)): if lst_2[i]>5: lst_2[i]=0 print(lst_2) lst_3 = [lst_1]+[lst_2] print(list(zip(*lst_3))) A = ...
en
0.438117
lst_1 = [1,2,3] lst_2 = [9,4,5,6] for i in range(len(lst_2)): if lst_2[i]>5: lst_2[i]=0 print(lst_2) lst_3 = [lst_1]+[lst_2] print(list(zip(*lst_3))) A = [1,2,3] B = [6,5,4] C = [7,8,9] X = [A] + [B] + [C] print(list(zip(*X))) t = 2 m = [] while t<0: t-=1 z = [float(i) for i in input().split()] m += z prin...
3.291732
3
scripts_pipeline/feature_extraction/Hatebase.py
paulafortuna/HatEval_public
1
6622290
from scripts_pipeline.Dataset import Dataset from scripts_pipeline.feature_extraction.FeatureExtraction import Parameters, FeatureExtraction from scripts_pipeline.PathsManagement import PathsManagement as Paths import pandas as pd import numpy as np from nltk.corpus import stopwords from nltk.tokenize import word_toke...
from scripts_pipeline.Dataset import Dataset from scripts_pipeline.feature_extraction.FeatureExtraction import Parameters, FeatureExtraction from scripts_pipeline.PathsManagement import PathsManagement as Paths import pandas as pd import numpy as np from nltk.corpus import stopwords from nltk.tokenize import word_toke...
en
0.862563
Parameters to be used in the Hatebase feature extraction. Implements methods for Hatebase feature extraction. It is a Child Class of FeatureExtraction, and it can be instantiated because it implements conduct_feature_extraction method. Calls the parent class FeatureExtraction initiator. :param parameter...
2.869561
3
src/tests/__init__.py
francesco-p/FACIL
243
6622291
import os import torch import shutil from main_incremental import main import datasets.dataset_config as c def run_main(args_line, result_dir='results_test', clean_run=False): assert "--results-path" not in args_line print('Staring dir:', os.getcwd()) if os.getcwd().endswith('tests'): os.chdir('...
import os import torch import shutil from main_incremental import main import datasets.dataset_config as c def run_main(args_line, result_dir='results_test', clean_run=False): assert "--results-path" not in args_line print('Staring dir:', os.getcwd()) if os.getcwd().endswith('tests'): os.chdir('...
en
0.633062
# for testing - use relative path to CWD # if distributed test -- use all GPU # acc matrices sanity check # check current task performance
2.139751
2
learn/mymodel.py
starrysky9959/digital-recognition
0
6622292
""" @author starrysky @date 2020/08/16 @details 定义网络结构, 训练模型, 导出模型参数 """ import os import sys import time import pandas as pd import torch import torch.nn as nn from PIL import Image from torch.utils.data import Dataset, DataLoader from torchvision import transforms # 转换成28*28的Tensor格式 # trans = transforms.Compos...
""" @author starrysky @date 2020/08/16 @details 定义网络结构, 训练模型, 导出模型参数 """ import os import sys import time import pandas as pd import torch import torch.nn as nn from PIL import Image from torch.utils.data import Dataset, DataLoader from torchvision import transforms # 转换成28*28的Tensor格式 # trans = transforms.Compos...
zh
0.771908
@author starrysky @date 2020/08/16 @details 定义网络结构, 训练模型, 导出模型参数 # 转换成28*28的Tensor格式 # trans = transforms.Compose([ # transforms.Resize((28, 28)), # transforms.ToTensor(), # ]) 定义读取图片的格式为28*28的单通道灰度图 :param path: 图片路径 :return: 图片 制作数据集 :param csv_path: 文件路径 :param transform: 转后后的Tensor格式 ...
2.872126
3
logger/logger_meta/base_logger.py
JiahuiLei/Pix2Surf
26
6622293
<reponame>JiahuiLei/Pix2Surf class BaseLogger(object): def __init__(self, tb_logger, log_path, cfg): super().__init__() self.cfg = cfg self.NAME = 'base' self.tb = tb_logger self.log_path = log_path # make dir def log_phase(self): pass def log_batch(...
class BaseLogger(object): def __init__(self, tb_logger, log_path, cfg): super().__init__() self.cfg = cfg self.NAME = 'base' self.tb = tb_logger self.log_path = log_path # make dir def log_phase(self): pass def log_batch(self, batch): pass
en
0.587136
# make dir
2.271172
2
mycarehub/common/migrations/0014_facility_phone.py
savannahghi/mycarehub-backend
1
6622294
<gh_stars>1-10 # Generated by Django 3.2.9 on 2021-11-29 08:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('common', '0013_alter_facilityattachment_content_type'), ] operations = [ migrations.AddField( model_name='facilit...
# Generated by Django 3.2.9 on 2021-11-29 08:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('common', '0013_alter_facilityattachment_content_type'), ] operations = [ migrations.AddField( model_name='facility', ...
en
0.831161
# Generated by Django 3.2.9 on 2021-11-29 08:46
1.41833
1
app/language_features/alt_input.py
andykmiles/code-boutique
0
6622295
<filename>app/language_features/alt_input.py import sys print("does it") the_input = sys.stdin.readline()
<filename>app/language_features/alt_input.py import sys print("does it") the_input = sys.stdin.readline()
none
1
1.853448
2
src/app/image_viewer/vertex.py
northfieldzz/vision_tester
0
6622296
<gh_stars>0 class Vertex: def __init__(self, x, y): self.x = x self.y = y @property def tuple(self): return self.x, self.y
class Vertex: def __init__(self, x, y): self.x = x self.y = y @property def tuple(self): return self.x, self.y
none
1
2.997449
3
Excel2MySQL/dumps.py
sw5cc/Excel2MySQL
0
6622297
<reponame>sw5cc/Excel2MySQL # -*- utf-8 -*- import mysql.connector from openpyxl import load_workbook from settings import * def insert_record(isbn, name, price): server = mysql.connector.connect(user=MYSQL_USER, password=<PASSWORD>, data...
# -*- utf-8 -*- import mysql.connector from openpyxl import load_workbook from settings import * def insert_record(isbn, name, price): server = mysql.connector.connect(user=MYSQL_USER, password=<PASSWORD>, database=MYSQL_DATABASE, ...
en
0.50109
# -*- utf-8 -*- # :type: list of :class:`openpyxl.worksheet.worksheet.Worksheet`
2.830943
3
rlkit/envs/half_cheetah_non_stationary_rand_params.py
BZSROCKETS/cemrl
0
6622298
<filename>rlkit/envs/half_cheetah_non_stationary_rand_params.py from meta_rand_envs.half_cheetah_non_stationary_rand_mass_params import HalfCheetahNonStationaryRandMassParamEnv from . import register_env @register_env('cheetah-non-stationary-rand-mass-params') class HalfCheetahNonStationaryRandMassParamWrappedEnv(Hal...
<filename>rlkit/envs/half_cheetah_non_stationary_rand_params.py from meta_rand_envs.half_cheetah_non_stationary_rand_mass_params import HalfCheetahNonStationaryRandMassParamEnv from . import register_env @register_env('cheetah-non-stationary-rand-mass-params') class HalfCheetahNonStationaryRandMassParamWrappedEnv(Hal...
none
1
1.73417
2
WrapperMap__work_with_dict_through_atts.py
gil9red/SimplePyScripts
117
6622299
<gh_stars>100-1000 #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' class WrapperMap: def __init__(self, d: dict): self.d = d def get_value(self): return self.d def __getattr__(self, item: str): value = self.d.get(item) if isinstance(value, dict): ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' class WrapperMap: def __init__(self, d: dict): self.d = d def get_value(self): return self.d def __getattr__(self, item: str): value = self.d.get(item) if isinstance(value, dict): return s...
en
0.157351
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # {'id': 123, 'username': 'username', 'full_name': 'fullName'} <class '__main__.WrapperMap'> # 123 <class 'int'> # username <class 'str'>
2.937154
3
common.py
zhaoyueyi/TaichiRenderer
0
6622300
# @Time : 2021/4/30 23:02 # @Author : 赵曰艺 # @File : common.py # @Software: PyCharm # coding:utf-8 import taichi as ti import taichi_glsl as ts import numpy as np from tr_utils import texture_as_field MAX = 2**20 def V(*xs): return ti.Vector(xs) @ti.pyfunc def ifloor(x): return int(ti.floor(x)) @ti.pyfunc d...
# @Time : 2021/4/30 23:02 # @Author : 赵曰艺 # @File : common.py # @Software: PyCharm # coding:utf-8 import taichi as ti import taichi_glsl as ts import numpy as np from tr_utils import texture_as_field MAX = 2**20 def V(*xs): return ti.Vector(xs) @ti.pyfunc def ifloor(x): return int(ti.floor(x)) @ti.pyfunc d...
fr
0.164307
# @Time : 2021/4/30 23:02 # @Author : 赵曰艺 # @File : common.py # @Software: PyCharm # coding:utf-8
2.173332
2
reference_code/alex_slalom.py
apanas9246/GRANDPRIX
0
6622301
<filename>reference_code/alex_slalom.py """ Copyright MIT and Harvey Mudd College MIT License Summer 2020 Phase 1 Challenge - Cone Slaloming """ ######################################################################################## # Imports ##########################################################################...
<filename>reference_code/alex_slalom.py """ Copyright MIT and Harvey Mudd College MIT License Summer 2020 Phase 1 Challenge - Cone Slaloming """ ######################################################################################## # Imports ##########################################################################...
en
0.668284
Copyright MIT and Harvey Mudd College MIT License Summer 2020 Phase 1 Challenge - Cone Slaloming ######################################################################################## # Imports ######################################################################################## ##################################...
2.157152
2
TwitterAPI_exploring/twitterSearch.py
LuisFeliciano/BokChoy
1
6622302
import constants import tweepy from tweepy import Stream from tweepy.streaming import StreamListener def main(): authentication = tweepy.OAuthHandler(constants.API_KEY, constants.API_SECRET_KEY) authentication.set_access_token(constants.ACCESS_TOKEN, constants.ACCESS_SECRET_TOKEN) api = tweepy.API(authenti...
import constants import tweepy from tweepy import Stream from tweepy.streaming import StreamListener def main(): authentication = tweepy.OAuthHandler(constants.API_KEY, constants.API_SECRET_KEY) authentication.set_access_token(constants.ACCESS_TOKEN, constants.ACCESS_SECRET_TOKEN) api = tweepy.API(authenti...
none
1
3.151666
3
app/main.py
sarahalamdari/DIRECT_capstone
1
6622303
<filename>app/main.py import base64 import json import os import pickle import copy import datetime as dt import pandas as pd import numpy as np from flask import Flask #from flask_cors import CORS import dash from dash.dependencies import Input, Output, State import dash_core_components as dcc import dash_html_compone...
<filename>app/main.py import base64 import json import os import pickle import copy import datetime as dt import pandas as pd import numpy as np from flask import Flask #from flask_cors import CORS import dash from dash.dependencies import Input, Output, State import dash_core_components as dcc import dash_html_compone...
en
0.393073
#from flask_cors import CORS #app.scripts.config.serve_locally = True # noqa: E501 #server = app.server #CORS(server) #if 'DYNO' in os.environ: # app.scripts.append_script({ # 'external_url': 'https://cdn.rawgit.com/chriddyp/ca0d8f02a1659981a0ea7f013a378bbd/raw/e79f3f789517deec58f41251f7dbb6bee72c44ab/plotly_...
2.520674
3
generate_calibration_checkerboard.py
Jichao-Wang/Calibration_ZhangZhengyou_Method
2
6622304
<reponame>Jichao-Wang/Calibration_ZhangZhengyou_Method import cv2 import numpy as np cube = 90 row_corner = 9 col_corner = 12 img = np.zeros((row_corner * cube, col_corner * cube, 1), dtype="uint8") for i in range(img.shape[0]): for j in range(img.shape[1]): img[i, j] = 255 if (int(i / cube) % 2 ==...
import cv2 import numpy as np cube = 90 row_corner = 9 col_corner = 12 img = np.zeros((row_corner * cube, col_corner * cube, 1), dtype="uint8") for i in range(img.shape[0]): for j in range(img.shape[1]): img[i, j] = 255 if (int(i / cube) % 2 == 0) and (int(j / cube) % 2 == 0): img[i, j]...
none
1
2.833773
3
jh_server/apps/jidou_hikki/utils/demo.py
agent-whisper/Jidou-Hikki-Django
0
6622305
<gh_stars>0 import logging from typing import Dict, Tuple, List import jamdict from jamdict import Jamdict from ..tokenizer import get_tokenizer from ..tokenizer.base import Token from ..tokenizer.sudachi import MODE_B logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) logger.addHandler(logging.Stre...
import logging from typing import Dict, Tuple, List import jamdict from jamdict import Jamdict from ..tokenizer import get_tokenizer from ..tokenizer.base import Token from ..tokenizer.sudachi import MODE_B logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) logger.addHandler(logging.StreamHandler())...
en
0.615992
Pseuodo Vocabulary model without DB connection. #{self.dict_id}") # Assume the first entry to be the best match # Some tokens may be a set of expressions, and not available in # JMDict. Example cases: # - キャラ作り Similar to NotePage.analyze(), but returns the HTML text and list of DryVocabulary.
2.208233
2
tests/tests.py
dalemyers/libmonzo
7
6622306
#!/usr/bin/env python3 """Tests for the package.""" #pylint: disable=line-too-long import filecmp import json import os import random import sys import tempfile from typing import ClassVar, Dict import unittest import uuid import requests sys.path.insert(0, os.path.abspath(os.path.join(os.path.abspath(__file__), "...
#!/usr/bin/env python3 """Tests for the package.""" #pylint: disable=line-too-long import filecmp import json import os import random import sys import tempfile from typing import ClassVar, Dict import unittest import uuid import requests sys.path.insert(0, os.path.abspath(os.path.join(os.path.abspath(__file__), "...
en
0.815696
#!/usr/bin/env python3 Tests for the package. #pylint: disable=line-too-long #pylint: disable=wrong-import-position #pylint: enable=wrong-import-position Test the library. #cls.client.authenticate() #print(cls.client.access_token) Load the configuration. Test whoami. Test accounts. Test balances. Test pots. Test pot de...
2.23144
2
yandisk-downloader.py
ProgramYazar/yandex_downloader
3
6622307
<filename>yandisk-downloader.py import os import requests URL_TEMPLATE = 'https://cloud-api.yandex.net/v1/disk/public/resources?public_key={pk}&limit=10000000' def recursive_list(public_key: str, path=''): files = [] _url = URL_TEMPLATE.format(pk=public_key) if path != '': _url += '&path=' + pat...
<filename>yandisk-downloader.py import os import requests URL_TEMPLATE = 'https://cloud-api.yandex.net/v1/disk/public/resources?public_key={pk}&limit=10000000' def recursive_list(public_key: str, path=''): files = [] _url = URL_TEMPLATE.format(pk=public_key) if path != '': _url += '&path=' + pat...
none
1
3.208523
3
numerical/matrix/linear_sys.py
luizmugnaini/numerical
0
6622308
""" Authors: <NAME> (nUSP: 11809746) <NAME> (nUSP: 11807702) <NAME> (nUSP: 11809090) Computacao III (CCM): EP 2 Cubic interpolating splines: SquareMatrix, Tridiagonal, Periodic EP 3 QR Factorization: Qr """ from numerical.matrix.linear_space import RealSpace import numpy as np class Square...
""" Authors: <NAME> (nUSP: 11809746) <NAME> (nUSP: 11807702) <NAME> (nUSP: 11809090) Computacao III (CCM): EP 2 Cubic interpolating splines: SquareMatrix, Tridiagonal, Periodic EP 3 QR Factorization: Qr """ from numerical.matrix.linear_space import RealSpace import numpy as np class Square...
en
0.752554
Authors: <NAME> (nUSP: 11809746) <NAME> (nUSP: 11807702) <NAME> (nUSP: 11809090) Computacao III (CCM): EP 2 Cubic interpolating splines: SquareMatrix, Tridiagonal, Periodic EP 3 QR Factorization: Qr Methods for square matrices General, in-place, gaussian elimination. If `lu_decomp` i...
3.840154
4
profiles/forms.py
vkendurkar/StudentCouncil
1
6622309
from django import forms from django.contrib.auth.models import User from django.core.validators import RegexValidator class UserForm(forms.Form): username = forms.CharField(max_length=20) name = forms.CharField(max_length=50) email = forms.EmailField() class ProfileForm(forms.Form): BRANCH_LIST = [('CH', 'Chemic...
from django import forms from django.contrib.auth.models import User from django.core.validators import RegexValidator class UserForm(forms.Form): username = forms.CharField(max_length=20) name = forms.CharField(max_length=50) email = forms.EmailField() class ProfileForm(forms.Form): BRANCH_LIST = [('CH', 'Chemic...
none
1
2.465864
2
tests/plugins/test_beattv.py
mattrick/streamlink
2
6622310
<gh_stars>1-10 import unittest from streamlink.plugins.beattv import BeatTV class TestPluginBeatTV(unittest.TestCase): def test_can_handle_url(self): should_match = [ 'http://be-at.tv/video/adam_beyer_hyte_nye_germany_2018', 'https://www.be-at.tv/videos/ben-klock-great-wall-festiv...
import unittest from streamlink.plugins.beattv import BeatTV class TestPluginBeatTV(unittest.TestCase): def test_can_handle_url(self): should_match = [ 'http://be-at.tv/video/adam_beyer_hyte_nye_germany_2018', 'https://www.be-at.tv/videos/ben-klock-great-wall-festival-2019' ...
none
1
3.059801
3
Beginner/03. Python/DoubleIndex.py
ankita080208/Hacktoberfest
1
6622311
<gh_stars>1-10 """ Create a function named double_index that has two parameters: a list named lst and a single number named index. The function should return a new list where all elements are the same as in lst except for the element at index. The element at index should be double the value of the element at index of t...
""" Create a function named double_index that has two parameters: a list named lst and a single number named index. The function should return a new list where all elements are the same as in lst except for the element at index. The element at index should be double the value of the element at index of the original lst...
en
0.842734
Create a function named double_index that has two parameters: a list named lst and a single number named index. The function should return a new list where all elements are the same as in lst except for the element at index. The element at index should be double the value of the element at index of the original lst. If...
4.288657
4
tests/test_itemDef_define.py
swhume/odmlib
9
6622312
<reponame>swhume/odmlib from unittest import TestCase import json import odmlib.define_2_0.model as DEFINE class TestItemDef(TestCase): def setUp(self) -> None: attrs = self.set_item_attributes() self.item = DEFINE.ItemDef(**attrs) def test_required_attributes_only(self): attrs = {"OI...
from unittest import TestCase import json import odmlib.define_2_0.model as DEFINE class TestItemDef(TestCase): def setUp(self) -> None: attrs = self.set_item_attributes() self.item = DEFINE.ItemDef(**attrs) def test_required_attributes_only(self): attrs = {"OID": "ODM.IT.AE.AEYN", "N...
en
0.474383
# Description requires a Description object, not a RangeCheck object set some ItemDef element attributes using test data :return: dictionary with ItemDef attribute information
2.688236
3
src/_Utils/urlValidator.py
krisHans3n/ifd_standardised_api_prod
0
6622313
<filename>src/_Utils/urlValidator.py import validators def validate_url_string(url_arr): for url in url_arr: if not validators.url(url): url_arr.remove(url) return url_arr
<filename>src/_Utils/urlValidator.py import validators def validate_url_string(url_arr): for url in url_arr: if not validators.url(url): url_arr.remove(url) return url_arr
none
1
2.768481
3
create_data.py
Emocial-NLP-Depression-Detection/Emocial-AI-Thai
1
6622314
<filename>create_data.py from pythainlp.sentiment import sentiment import twint import pandas as pd import os import emoji import re c = twint.Config() c.Search = "โรคซึมเศร้า" c.Limit = 100000 c.Store_csv = True c.Output = "./data/raw_depressed_data.csv" c.Lang = 'th' p = twint.Config() p.Search = "เรา" p.Limit = 1000...
<filename>create_data.py from pythainlp.sentiment import sentiment import twint import pandas as pd import os import emoji import re c = twint.Config() c.Search = "โรคซึมเศร้า" c.Limit = 100000 c.Store_csv = True c.Output = "./data/raw_depressed_data.csv" c.Lang = 'th' p = twint.Config() p.Search = "เรา" p.Limit = 1000...
en
0.134495
# def translate(x): # return TextBlob(x).translate(to="th") # print(i) # print(f"Index: {index}\n I: {i}")
3.102421
3
hvm/vm/forks/frontier/transactions.py
hyperevo/py-helios-node
0
6622315
import rlp_cython as rlp from hvm.constants import ( CREATE_CONTRACT_ADDRESS, GAS_TX, GAS_TXDATAZERO, GAS_TXDATANONZERO, ) from hvm.validation import ( validate_uint256, validate_is_integer, validate_is_bytes, validate_lt_secpk1n, validate_lte, validate_gte, validate_canonic...
import rlp_cython as rlp from hvm.constants import ( CREATE_CONTRACT_ADDRESS, GAS_TX, GAS_TXDATAZERO, GAS_TXDATANONZERO, ) from hvm.validation import ( validate_uint256, validate_is_integer, validate_is_bytes, validate_lt_secpk1n, validate_lte, validate_gte, validate_canonic...
none
1
2.053425
2
Datacamp Assignments/Data Engineer Track/3. Software Engineering & Data Science/2_leveraging_documentation.py
Ali-Parandeh/Data_Science_Playground
0
6622316
# load the Counter function into our environment from collections import Counter # View the documentation for Counter.most_common help(Counter.most_common) ''' Help on function most_common in module collections: most_common(self, n=None) List the n most common elements and their counts from the most common ...
# load the Counter function into our environment from collections import Counter # View the documentation for Counter.most_common help(Counter.most_common) ''' Help on function most_common in module collections: most_common(self, n=None) List the n most common elements and their counts from the most common ...
en
0.711798
# load the Counter function into our environment # View the documentation for Counter.most_common Help on function most_common in module collections: most_common(self, n=None) List the n most common elements and their counts from the most common to the least. If n is None, then list all element counts. ...
4.117953
4
pycon_project/apps/oauth_callbacks.py
pytexas/pycon
1
6622317
from django.conf import settings from django.core.urlresolvers import reverse from django.template import RequestContext from django.shortcuts import render_to_response, redirect from django.utils.translation import ugettext from django.contrib import messages from django.contrib.auth import authenticate, login from d...
from django.conf import settings from django.core.urlresolvers import reverse from django.template import RequestContext from django.shortcuts import render_to_response, redirect from django.utils.translation import ugettext from django.contrib import messages from django.contrib.auth import authenticate, login from d...
en
0.836155
# @@@ pulled from Pinax (a class based view would be awesome here # to reduce duplication) # del request.session["oauth_signup_data"]
2.175012
2
python/run_app.py
tadayoni1/books
0
6622318
<reponame>tadayoni1/books import os from api._01_manual_response_class import app # from api._02_make_response_helper import app # from api._03_post_method import app # from api._04_delete_method import app # from api._05_flask_restful_simple import app if __name__ == '__main__': app.debug = True app.config[...
import os from api._01_manual_response_class import app # from api._02_make_response_helper import app # from api._03_post_method import app # from api._04_delete_method import app # from api._05_flask_restful_simple import app if __name__ == '__main__': app.debug = True app.config['DATABASE_NAME'] = 'librar...
en
0.520443
# from api._02_make_response_helper import app # from api._03_post_method import app # from api._04_delete_method import app # from api._05_flask_restful_simple import app
1.92224
2
export_readiness/migrations/0039_auto_20190411_1206.py
uktrade/directory-cms
6
6622319
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-11 12:06 from __future__ import unicode_literals import core.model_fields import core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('export_readiness', '0038_auto_20190402_1221...
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-11 12:06 from __future__ import unicode_literals import core.model_fields import core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('export_readiness', '0038_auto_20190402_1221...
en
0.63279
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-11 12:06
1.583027
2
code/dataset/base.py
lindsey98/Proxy-Anchor-CVPR2020
0
6622320
from __future__ import print_function from __future__ import division import os import torch import torchvision import numpy as np import PIL.Image from shutil import copyfile import time from distutils.dir_util import copy_tree class BaseDataset(torch.utils.data.Dataset): def __init__(self, root, mode, transfo...
from __future__ import print_function from __future__ import division import os import torch import torchvision import numpy as np import PIL.Image from shutil import copyfile import time from distutils.dir_util import copy_tree class BaseDataset(torch.utils.data.Dataset): def __init__(self, root, mode, transfo...
en
0.066712
# convert gray to rgb #print(self.classes) #print(len(set(self.ys)), len(set(self.classes))) #print(type(self.ys)) #print(len(set(self.ys) & set(self.classes))) # convert gray to rgb
2.481269
2
pylogflow/Pylogflow.py
JacobMaldonado/pylogflow
0
6622321
class IntentMap(): # Default constructor for init class def __init__(self): self.__map = {} # Matches one intent to a method to execute def add(self, intentName, method): self.__map[intentName] = method # execute an intent that matches with given in the response, # the respons...
class IntentMap(): # Default constructor for init class def __init__(self): self.__map = {} # Matches one intent to a method to execute def add(self, intentName, method): self.__map[intentName] = method # execute an intent that matches with given in the response, # the respons...
en
0.685899
# Default constructor for init class # Matches one intent to a method to execute # execute an intent that matches with given in the response, # the response will be an error method if an intent does not match # return will be an dictionary # Error method triggered when intent does not match # Constructor of message bui...
3.077306
3
app/main.py
hadaskedar2020/calendar
1
6622322
<reponame>hadaskedar2020/calendar from fastapi import FastAPI, Request from fastapi.templating import Jinja2Templates app = FastAPI() templates = Jinja2Templates(directory="templates") @app.get("/") def home(request: Request): return templates.TemplateResponse("home.html", { "request": request, ...
from fastapi import FastAPI, Request from fastapi.templating import Jinja2Templates app = FastAPI() templates = Jinja2Templates(directory="templates") @app.get("/") def home(request: Request): return templates.TemplateResponse("home.html", { "request": request, "message": "Hello, World!" })
none
1
2.558193
3
world_model.py
dohyun1411/gpt3-sandbox
0
6622323
<gh_stars>0 from api import GPT, Example, set_openai_key set_openai_key('<KEY>')
from api import GPT, Example, set_openai_key set_openai_key('<KEY>')
none
1
1.277703
1
mgui/mgui_root.py
Dreagonmon/micropython-mgui
1
6622324
from mgui import mgui_const as C from mgui.mgui_utils import get_context from mgui.utils.bmfont import FontDrawAscii try: import uasyncio as asyncio from utime import ticks_ms as time_ms from usys import print_exception is_debug = False except: import asyncio from time import time_ns as _time_ns...
from mgui import mgui_const as C from mgui.mgui_utils import get_context from mgui.utils.bmfont import FontDrawAscii try: import uasyncio as asyncio from utime import ticks_ms as time_ms from usys import print_exception is_debug = False except: import asyncio from time import time_ns as _time_ns...
en
0.408489
# useless import for type hints # type: (Optional[MGuiContext]) -> None # type Color # type Color # type int # type int # type FontDraw # type: (MGuiView, MGuiScreen) -> Coroutine[Any, Any, NoReturn] # print("Abort.") # print(self.__context[CONTEXT_FRAME_DURATION]) # type: (MGuiEvent) -> bool
2.132463
2
unit_test/test_losses.py
One-sixth/model-utils-torch
0
6622325
import unittest import torch import math from model_utils_torch.losses import * class TestLosses(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def test_circle_loss(self): batch_size = 6 feats = torch.rand(batch_size, 16) classes ...
import unittest import torch import math from model_utils_torch.losses import * class TestLosses(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def test_circle_loss(self): batch_size = 6 feats = torch.rand(batch_size, 16) classes ...
none
1
2.797864
3
source/lambda/graph-modelling/index.py
songhuiming/sagemaker-graph-fraud-detection
0
6622326
<filename>source/lambda/graph-modelling/index.py<gh_stars>0 import os import boto3 import tarfile from time import strftime, gmtime s3_client = boto3.client('s3') def process_event(event, context): print(event) event_source_s3 = event['Records'][0]['s3'] print("S3 Put event source: {}".format(get_full_...
<filename>source/lambda/graph-modelling/index.py<gh_stars>0 import os import boto3 import tarfile from time import strftime, gmtime s3_client = boto3.client('s3') def process_event(event, context): print(event) event_source_s3 = event['Records'][0]['s3'] print("S3 Put event source: {}".format(get_full_...
none
1
2.232861
2
shakenfist/alembic/versions/6423651f41b1_add_order_to_network_interfaces.py
bradh/shakenfist
0
6622327
<reponame>bradh/shakenfist """Add order to networkinterfaces. Revision ID: 6423651f41b1 Revises: <KEY> Create Date: 2020-04-04 12:57:43.336424 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '<KEY>' branch_labels = None depends_on = None...
"""Add order to networkinterfaces. Revision ID: 6423651f41b1 Revises: <KEY> Create Date: 2020-04-04 12:57:43.336424 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '<KEY>' branch_labels = None depends_on = None def upgrade(): op.ad...
en
0.502213
Add order to networkinterfaces. Revision ID: 6423651f41b1 Revises: <KEY> Create Date: 2020-04-04 12:57:43.336424 # revision identifiers, used by Alembic.
1.221995
1
TestCase/test_search.py
LiuTianen/AppiumTestDemo
0
6622328
<filename>TestCase/test_search.py from app import App import time class TestSearch: def setup(self): self.search_page=App.start().to_search() def test_search_po(self): self.search_page.search("alibaba") assert self.search_page.get_current_price() > "10" self.search_page.close()...
<filename>TestCase/test_search.py from app import App import time class TestSearch: def setup(self): self.search_page=App.start().to_search() def test_search_po(self): self.search_page.search("alibaba") assert self.search_page.get_current_price() > "10" self.search_page.close()...
none
1
2.737685
3
djangoproject/notifications/models.py
moonmirXD/E-barangay
0
6622329
<reponame>moonmirXD/E-barangay<gh_stars>0 from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django.conf import settings User = settings.AUTH_USER_MODEL concern_choices = [ ('Requested Document','Requested Document'), ('Complaint','Complaint'), ] class ...
from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django.conf import settings User = settings.AUTH_USER_MODEL concern_choices = [ ('Requested Document','Requested Document'), ('Complaint','Complaint'), ] class Send_notification(models.Model): #user_re...
en
0.368857
#user_reciever = models.ForeignKey(User,max_length=100,on_delete =models.CASCADE) # sender to user # def get_absolute_url(self): # return reverse('post-detail', kwargs={'pk':self.pk})
2.192868
2
MacOSX/Firefly Activity Access/python/activity/datastore.py
mpkasp/firefly-ice-api
0
6622330
import datetime from dateutil import parser import json import os import struct class HardwareRange: def __init__(self, hardware_identifier=None, start=None, end=None): self.hardware_identifier = hardware_identifier self.start = start self.end = end def __repr__(self): return ...
import datetime from dateutil import parser import json import os import struct class HardwareRange: def __init__(self, hardware_identifier=None, start=None, end=None): self.hardware_identifier = hardware_identifier self.start = start self.end = end def __repr__(self): return ...
none
1
2.856005
3
batch.py
sorz/asstosrt
240
6622331
from __future__ import print_function import argparse import codecs import sys import os import asstosrt from asstosrt import translate def _get_args(): parser = argparse.ArgumentParser(description='A useful tool that \ convert Advanced SubStation Alpha (ASS/SSA) subtitle files \ ...
from __future__ import print_function import argparse import codecs import sys import os import asstosrt from asstosrt import translate def _get_args(): parser = argparse.ArgumentParser(description='A useful tool that \ convert Advanced SubStation Alpha (ASS/SSA) subtitle files \ ...
en
0.551129
Import chardet or exit. Try detect the charset of file, return the name of charset or exit. Return the BOM of UTF-16/32 or empty str. Return all ASS/SSA file on current working directory. # Detect file charset. # Enable auto detect
2.690824
3
rl_suite/algo/sac_rad.py
gauthamvasan/rl_suite
1
6622332
import torch import copy import time import os import threading import numpy as np import torch.nn as nn import torch.nn.functional as F import torch.multiprocessing as mp from copy import deepcopy from rl_suite.algo.cnn_policies import SACRADActor, SACRADCritic from rl_suite.algo.replay_buffer import SACRADBuffer ...
import torch import copy import time import os import threading import numpy as np import torch.nn as nn import torch.nn.functional as F import torch.multiprocessing as mp from copy import deepcopy from rl_suite.algo.cnn_policies import SACRADActor, SACRADCritic from rl_suite.algo.replay_buffer import SACRADBuffer ...
en
0.729192
SAC algorithm. # also copies the encoder instance # set target entropy to -|A| # optimizers # get current Q estimates # Ignore terminal transitions to enable infinite bootstrap #(current_Q1 - target_Q) ** 2 + (current_Q2 - target_Q) ** 2 # Optimize the critic #torch.nn.utils.clip_grad_norm_(self.critic.parameters(), 1)...
2.096735
2
zonys/core/freebsd/mount/nullfs.py
zonys/zonys
1
6622333
import pathlib import subprocess import zonys import zonys.core import zonys.core.freebsd import zonys.core.freebsd.mount class Mountpoint(zonys.core.freebsd.mount.Mountpoint): def __init__(self, source, destination, read_only=True): super().__init__(destination) if isinstance(source, str): ...
import pathlib import subprocess import zonys import zonys.core import zonys.core.freebsd import zonys.core.freebsd.mount class Mountpoint(zonys.core.freebsd.mount.Mountpoint): def __init__(self, source, destination, read_only=True): super().__init__(destination) if isinstance(source, str): ...
none
1
2.102353
2
goalgetter/blueprints/goals/views.py
shingtzewoo/goalgetter
0
6622334
from flask import Blueprint, render_template, url_for, flash, request, redirect from flask_login import login_required, current_user from goalgetter.blueprints.goals.models.values import Value from goalgetter.blueprints.goals.models.goals import Goal from goalgetter.blueprints.goals.models.milestones import Milesto...
from flask import Blueprint, render_template, url_for, flash, request, redirect from flask_login import login_required, current_user from goalgetter.blueprints.goals.models.values import Value from goalgetter.blueprints.goals.models.goals import Goal from goalgetter.blueprints.goals.models.milestones import Milesto...
en
0.886349
# https://stackoverflow.com/questions/59656684/how-do-i-store-multiple-checkbox-data-in-a-list-of-array # Connecting the goals to the correct values # Updating user's completion stage to 2 for the questionnaire, there are 3 stages in total # Connecting each milestone to a goal and setting the start and end date for eac...
2.484472
2
webserver/app/auth.py
lrazovic/advanced_programming
1
6622335
<reponame>lrazovic/advanced_programming<gh_stars>1-10 from fastapi import FastAPI from authlib.integrations.starlette_client import OAuthError from starlette.requests import Request from starlette.responses import JSONResponse, RedirectResponse, HTMLResponse from starlette.middleware.sessions import SessionMiddleware f...
from fastapi import FastAPI from authlib.integrations.starlette_client import OAuthError from starlette.requests import Request from starlette.responses import JSONResponse, RedirectResponse, HTMLResponse from starlette.middleware.sessions import SessionMiddleware from datetime import datetime from models import User, ...
en
0.401603
# request.session.pop("user", None) # Check if token is not expired # Validate email # Create and return token ############################################################## # Pydantic model to dictionary explicit conversion # TODO: Use BCrypt instead of SHA256 # Reference: https://passlib.readthedocs.io/en/stable/lib/...
2.391857
2
gallery/urls.py
KimLHill/MSP4
0
6622336
from django.urls import path from . import views # Gallery URLs urlpatterns = [ path('', views.gallery, name='gallery'), path('<int:gallery_id>/', views.gallery_detail, name='gallery_detail'), path('add/', views.add_gallery, name='add_gallery'), path('edit/<int:gallery_id>/', views.edit_gallery, name='...
from django.urls import path from . import views # Gallery URLs urlpatterns = [ path('', views.gallery, name='gallery'), path('<int:gallery_id>/', views.gallery_detail, name='gallery_detail'), path('add/', views.add_gallery, name='add_gallery'), path('edit/<int:gallery_id>/', views.edit_gallery, name='...
en
0.265502
# Gallery URLs
1.730906
2
tool/admin/app/batserver/batbuild.py
mever/qooxdoo
1
6622337
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2007-2009 1&1 Internet AG, Germany, http://www.1und1.de # # License: # MIT: https://opensource.or...
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2007-2009 1&1 Internet AG, Germany, http://www.1und1.de # # License: # MIT: https://opensource.or...
en
0.704919
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2007-2009 1&1 Internet AG, Germany, http://www.1und1.de # # License: # MIT: https://opensource.org...
1.959656
2
release_check.py
dwhswenson/autorelease
3
6622338
<filename>release_check.py #/usr/bin/env python from __future__ import print_function import sys import argparse import setup #import contact_map from packaging.version import Version from autorelease import DefaultCheckRunner, conda_recipe_version from autorelease.version import get_setup_version repo_path = '.' SET...
<filename>release_check.py #/usr/bin/env python from __future__ import print_function import sys import argparse import setup #import contact_map from packaging.version import Version from autorelease import DefaultCheckRunner, conda_recipe_version from autorelease.version import get_setup_version repo_path = '.' SET...
en
0.232306
#/usr/bin/env python #import contact_map #'package': contact_map.version.version, #skip = [checker.git_repo_checks.reasonable_desired_version]
1.927331
2
infrastructure/migrations/0002_auto_20170911_1629.py
comcidis/comcidis-portal
0
6622339
<reponame>comcidis/comcidis-portal<filename>infrastructure/migrations/0002_auto_20170911_1629.py # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-11 16:29 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ...
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-11 16:29 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('infrastructure', '0001_initial'), ] operations = [ migrations.AlterField( ...
en
0.776688
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-11 16:29
1.801157
2
botleft.py
judasgutenberg/rover
1
6622340
<gh_stars>1-10 import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(24,GPIO.OUT) GPIO.output(24, GPIO.HIGH) GPIO.setup(19,GPIO.OUT) GPIO.setup(26,GPIO.OUT) GPIO.output(19, GPIO.LOW) GPIO.output(26, GPIO.HIGH) for x in range(0,10): GPIO.output(24, GPIO.HIGH) time.sleep(0.02) GPIO.output(24, GPIO.L...
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(24,GPIO.OUT) GPIO.output(24, GPIO.HIGH) GPIO.setup(19,GPIO.OUT) GPIO.setup(26,GPIO.OUT) GPIO.output(19, GPIO.LOW) GPIO.output(26, GPIO.HIGH) for x in range(0,10): GPIO.output(24, GPIO.HIGH) time.sleep(0.02) GPIO.output(24, GPIO.LOW) time.sleep...
none
1
2.803625
3
scripts/format_source.py
vmware/vmaccel
3
6622341
<reponame>vmware/vmaccel<filename>scripts/format_source.py #!/usr/bin/python """ ******************************************************************************* Copyright (c) 2016-2019 VMware, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted pro...
#!/usr/bin/python """ ******************************************************************************* Copyright (c) 2016-2019 VMware, 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: 1. Redist...
en
0.59428
#!/usr/bin/python ******************************************************************************* Copyright (c) 2016-2019 VMware, 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: 1. Redistribut...
1.352246
1
lib/si4703.py
Liorst4/aramcon-firmware
8
6622342
<gh_stars>1-10 # SI4703 RDS FM Receiver driver for CircuitPython # Released under the MIT License # Note: # Some of the code was inspired by https://github.com/achilikin/RdSpi, for which the license # is unclear - some of the source files specify GPLv2+, while others specify BSD. # # Copyright (c) 2019, 2020 <NAME> an...
# SI4703 RDS FM Receiver driver for CircuitPython # Released under the MIT License # Note: # Some of the code was inspired by https://github.com/achilikin/RdSpi, for which the license # is unclear - some of the source files specify GPLv2+, while others specify BSD. # # Copyright (c) 2019, 2020 <NAME> and <NAME> from ...
en
0.813656
# SI4703 RDS FM Receiver driver for CircuitPython # Released under the MIT License # Note: # Some of the code was inspired by https://github.com/achilikin/RdSpi, for which the license # is unclear - some of the source files specify GPLv2+, while others specify BSD. # # Copyright (c) 2019, 2020 <NAME> and <NAME> # POWER...
2.114577
2
tools/spm_to_vocab.py
Waino/OpenNMT-py
6
6622343
# converts a SentencePiece vocabulary to the format expected by dynamicdata # (essentially converts float expected counts to "fixed precision" int pseudocounts, # and inverts the order) import sys import math OMIT = ('<unk>', '<s>', '</s>') def convert(lines): for line in lines: w, c = line.rstrip('\n').s...
# converts a SentencePiece vocabulary to the format expected by dynamicdata # (essentially converts float expected counts to "fixed precision" int pseudocounts, # and inverts the order) import sys import math OMIT = ('<unk>', '<s>', '</s>') def convert(lines): for line in lines: w, c = line.rstrip('\n').s...
en
0.77877
# converts a SentencePiece vocabulary to the format expected by dynamicdata # (essentially converts float expected counts to "fixed precision" int pseudocounts, # and inverts the order)
3.090866
3
tests/test_get_data/test_imf_data.py
jm-rivera/pydeflate
0
6622344
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Nov 20 12:18:13 2021 @author: jorge """ import pytest from pydeflate.get_data import imf_data from pydeflate import config import sys import io import os def test__update_weo(): """Capture print statements which are only printed if download s...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Nov 20 12:18:13 2021 @author: jorge """ import pytest from pydeflate.get_data import imf_data from pydeflate import config import sys import io import os def test__update_weo(): """Capture print statements which are only printed if download s...
en
0.775212
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Sat Nov 20 12:18:13 2021 @author: jorge Capture print statements which are only printed if download successful # cleaning
2.149872
2
django/core/admin.py
reallinfo/lifelog
0
6622345
<filename>django/core/admin.py from django.contrib import admin from core.models import Action, Record admin.site.register(Action) admin.site.register(Record)
<filename>django/core/admin.py from django.contrib import admin from core.models import Action, Record admin.site.register(Action) admin.site.register(Record)
none
1
1.428022
1
Django 3 By Example-Book/Bookmark App/account/urls.py
ibnshayed/Python-Programming
0
6622346
<reponame>ibnshayed/Python-Programming from django.urls import path, include from django.contrib.auth.views import LoginView, LogoutView, PasswordChangeView, PasswordChangeDoneView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView from .views import user_login, dashboard, r...
from django.urls import path, include from django.contrib.auth.views import LoginView, LogoutView, PasswordChangeView, PasswordChangeDoneView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView from .views import user_login, dashboard, register, edit urlpatterns = [ # pa...
en
0.184897
# path('login/', user_login, name='login') # path('login/', LoginView.as_view(), name='login'), # path('logout/', LogoutView.as_view(), name='logout'), # change password urls # path('password_change/',PasswordChangeView.as_view(),name='password_change'), # path('password_change/done/',PasswordChangeDoneView.as_view(),n...
2.006099
2
extensions/ml_recommender/python/tests/test_user_to_items.py
woon5118/totara_ub
0
6622347
""" This file is part of Totara Enterprise Extensions. Copyright (C) 2020 onwards Totara Learning Solutions LTD Totara Enterprise Extensions is provided only to Totara Learning Solutions LTD's customers and partners, pursuant to the terms and conditions of a separate agreement with Totara Learning Solutions LTD or it...
""" This file is part of Totara Enterprise Extensions. Copyright (C) 2020 onwards Totara Learning Solutions LTD Totara Enterprise Extensions is provided only to Totara Learning Solutions LTD's customers and partners, pursuant to the terms and conditions of a separate agreement with Totara Learning Solutions LTD or it...
en
0.805776
This file is part of Totara Enterprise Extensions. Copyright (C) 2020 onwards Totara Learning Solutions LTD Totara Enterprise Extensions is provided only to Totara Learning Solutions LTD's customers and partners, pursuant to the terms and conditions of a separate agreement with Totara Learning Solutions LTD or its af...
2.026225
2
crawler/GithubDemoCrawler/GithubDemoCrawler/spiders/GithubDemoSpider.py
kingking888/SearchEngine
6
6622348
import scrapy import json import os from scrapy import signals from scrapy.http import Request from scrapy.xlib.pydispatch import dispatcher from CrawlerUtils.Catalog import DocCatalog from ..driver import github_driver from ..items import GithubdemocrawlerItem from lxml import etree class GithubDemoSpider(scrapy.Spid...
import scrapy import json import os from scrapy import signals from scrapy.http import Request from scrapy.xlib.pydispatch import dispatcher from CrawlerUtils.Catalog import DocCatalog from ..driver import github_driver from ..items import GithubdemocrawlerItem from lxml import etree class GithubDemoSpider(scrapy.Spid...
en
0.426701
# crawl pages # last_page = selector.xpath('//em[@class="current"]') # total_page = int(last_page[0].get('data-total-pages'))
2.427946
2
ServerApp.py
MattBcool/NLPTalk
1
6622349
<reponame>MattBcool/NLPTalk import time from models.GPT3 import GPT3 from server.ServerSocket import ServerSocket from utils import DataCleanser as dc def ServerApp(): while True: try: ss = ServerSocket(4824) ss.listen() except Exception as e: print('\nWaiting ...
import time from models.GPT3 import GPT3 from server.ServerSocket import ServerSocket from utils import DataCleanser as dc def ServerApp(): while True: try: ss = ServerSocket(4824) ss.listen() except Exception as e: print('\nWaiting 30 seconds for port to open....
en
0.664301
# Press the green button to run the script
2.461442
2
tackle/providers/pyinquirer/hooks/rawlist.py
geometry-labs/tackle-box
1
6622350
<reponame>geometry-labs/tackle-box """Raw list hook.""" from PyInquirer import prompt from pydantic import Field from typing import Any from tackle.models import BaseHook from tackle.utils.dicts import get_readable_key_path class InquirerRawListHook(BaseHook): """ Hook for PyInquirer 'rawlist' type prompts. ...
"""Raw list hook.""" from PyInquirer import prompt from pydantic import Field from typing import Any from tackle.models import BaseHook from tackle.utils.dicts import get_readable_key_path class InquirerRawListHook(BaseHook): """ Hook for PyInquirer 'rawlist' type prompts. Example: https://github.com/CI...
en
0.455563
Raw list hook. Hook for PyInquirer 'rawlist' type prompts. Example: https://github.com/CITGuru/PyInquirer/blob/master/examples/rawlist.py :param message: String message to show when prompting. :param choices: A list of strings or list of k/v pairs per above description :param name: A key to insert the ...
2.726957
3