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
aspath_graph/utils.py
coxley/aspath_graph
28
6630351
<gh_stars>10-100 ''' utils.py -------- Some common utilities ''' from __future__ import print_function import struct def dedupe(items): # This function is required because set() doesn't mantain list order which # is important when dealing with paths seen = set() for item in items: if item no...
''' utils.py -------- Some common utilities ''' from __future__ import print_function import struct def dedupe(items): # This function is required because set() doesn't mantain list order which # is important when dealing with paths seen = set() for item in items: if item not in seen: ...
en
0.815821
utils.py -------- Some common utilities # This function is required because set() doesn't mantain list order which # is important when dealing with paths # -> str Return label mapped to an ASN We follow a trend where if ASDOT notation, the value after the dot is metadata and before is the location. In this ca...
3.098931
3
server/chalicelib/secrets.py
friendchris/t-performance-dash
0
6630352
import os if 'MBTA_V2_API_KEY' in os.environ: MBTA_V2_API_KEY = os.environ['MBTA_V2_API_KEY'] MBTA_V3_API_KEY = os.environ['MBTA_V3_API_KEY'] else: MBTA_V2_API_KEY = '' MBTA_V3_API_KEY = ''
import os if 'MBTA_V2_API_KEY' in os.environ: MBTA_V2_API_KEY = os.environ['MBTA_V2_API_KEY'] MBTA_V3_API_KEY = os.environ['MBTA_V3_API_KEY'] else: MBTA_V2_API_KEY = '' MBTA_V3_API_KEY = ''
none
1
1.605078
2
pyy1/.pycharm_helpers/python_stubs/-1550516950/_tracemalloc.py
pyy1988/pyy_test1
0
6630353
# encoding: utf-8 # module _tracemalloc # from (built-in) # by generator 1.145 """ Debug module to trace memory blocks allocated by Python. """ # no imports # functions def clear_traces(): # real signature unknown; restored from __doc__ """ clear_traces() Clear traces of memory blocks allocated by Py...
# encoding: utf-8 # module _tracemalloc # from (built-in) # by generator 1.145 """ Debug module to trace memory blocks allocated by Python. """ # no imports # functions def clear_traces(): # real signature unknown; restored from __doc__ """ clear_traces() Clear traces of memory blocks allocated by Py...
en
0.762851
# encoding: utf-8 # module _tracemalloc # from (built-in) # by generator 1.145 Debug module to trace memory blocks allocated by Python. # no imports # functions # real signature unknown; restored from __doc__ clear_traces() Clear traces of memory blocks allocated by Python. # real signature unknown; restored f...
2.639787
3
src/commercetools/types/_base.py
mikedingjan/commercetools-python-sdk
0
6630354
<filename>src/commercetools/types/_base.py # DO NOT EDIT! This file is automatically generated import datetime import typing import attr if typing.TYPE_CHECKING: from ._common import Resource __all__ = ["PagedQueryResponse", "Update", "UpdateAction"] @attr.s(auto_attribs=True, init=False, repr=False) class Pag...
<filename>src/commercetools/types/_base.py # DO NOT EDIT! This file is automatically generated import datetime import typing import attr if typing.TYPE_CHECKING: from ._common import Resource __all__ = ["PagedQueryResponse", "Update", "UpdateAction"] @attr.s(auto_attribs=True, init=False, repr=False) class Pag...
en
0.305237
# DO NOT EDIT! This file is automatically generated #: :class:`int` #: Optional :class:`int` #: :class:`int` #: List of :class:`commercetools.types.Resource` #: :class:`int` #: :class:`list` #: :class:`str`
1.862405
2
Admission Counselling For Direct Second Year/Web-Application/AdmissionDirectSecondYear/TopMaharashtraCollegeList/views.py
atharvaagrawal/direct-second-year-admission-analysis
0
6630355
<reponame>atharvaagrawal/direct-second-year-admission-analysis<filename>Admission Counselling For Direct Second Year/Web-Application/AdmissionDirectSecondYear/TopMaharashtraCollegeList/views.py from django.shortcuts import render from . models import TopMaharashtraCollegeListModel from django.db import connection # ...
Counselling For Direct Second Year/Web-Application/AdmissionDirectSecondYear/TopMaharashtraCollegeList/views.py from django.shortcuts import render from . models import TopMaharashtraCollegeListModel from django.db import connection # Create your views here. def top_college_of_maharashtra(request): cursor = ...
en
0.968116
# Create your views here.
2.817563
3
c10_design/main.py
yonoho/pyalgorithm
0
6630356
from typing import Dict, List, Tuple def huffman_code(weighted_charset: List[Tuple[str, int]]) -> Dict[str, str]: weighted_charset.sort(key=lambda x: x[1]) trees = [] for char, weight in weighted_charset: trees.append({'v': char, 'w': weight}) while len(trees) > 1: new_tree = {'l': tre...
from typing import Dict, List, Tuple def huffman_code(weighted_charset: List[Tuple[str, int]]) -> Dict[str, str]: weighted_charset.sort(key=lambda x: x[1]) trees = [] for char, weight in weighted_charset: trees.append({'v': char, 'w': weight}) while len(trees) > 1: new_tree = {'l': tre...
none
1
3.435054
3
sdk/python/pulumi_aws/ssm/activation.py
Otanikotani/pulumi-aws
0
6630357
<reponame>Otanikotani/pulumi-aws # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequenc...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilitie...
en
0.744399
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** Registers an on-premises server or virtual machine with Amazon EC2 so that it can be managed using Run Command. ## Example Usag...
1.704631
2
scripts/release_issue_status/main.py
vincenttran-msft/azure-sdk-for-python
1
6630358
import time import os import re from datetime import date, datetime import subprocess as sp import traceback import logging from github import Github from reply_generator import AUTO_ASK_FOR_CHECK, begin_reply_generate from utils import update_issue_body, get_readme_and_output_folder, \ get_python_pipelines, get_...
import time import os import re from datetime import date, datetime import subprocess as sp import traceback import logging from github import Github from reply_generator import AUTO_ASK_FOR_CHECK, begin_reply_generate from utils import update_issue_body, get_readme_and_output_folder, \ get_python_pipelines, get_...
en
0.907981
#{}]({}) | {} | {} | {} | {} | {} | {} | {} |\n'.format(self.link.split('/')[-1], self.link, # get latest issue status # please fill user_token # get pipeline definitionid # make a ridiculous data to remind failure when error happens # rule1: if status is 'release', need to release asap # rule2: if latest comment is fr...
2.319818
2
examples/01_check_connectivity.py
cyb3rdog/escapepod_python_sdk
2
6630359
#!/usr/bin/env python3 # Copyright (c) 2021 cyb3rdog # # 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 in the file LICENSE.txt or at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless...
#!/usr/bin/env python3 # Copyright (c) 2021 cyb3rdog # # 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 in the file LICENSE.txt or at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless...
en
0.849727
#!/usr/bin/env python3 # Copyright (c) 2021 cyb3rdog # # 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 in the file LICENSE.txt or at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
1.273838
1
hardware/Tests/send_commands.py
unball/ieee-very-small
5
6630360
<reponame>unball/ieee-very-small import serial import struct s = serial.Serial('/dev/cu.usbserial-A600e0ti', baudrate=19200) while True: data_to_write = struct.pack('=B', input('>> ')) print 'Data:', data_to_write s.write(data_to_write)
import serial import struct s = serial.Serial('/dev/cu.usbserial-A600e0ti', baudrate=19200) while True: data_to_write = struct.pack('=B', input('>> ')) print 'Data:', data_to_write s.write(data_to_write)
none
1
2.584654
3
climateeconomics/tests/l1_test_gradient_carboncycle_discipline.py
os-climate/witness-core
1
6630361
<reponame>os-climate/witness-core<gh_stars>1-10 ''' Copyright 2022 Airbus SAS 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...
''' Copyright 2022 Airbus SAS 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, software dis...
en
0.785716
Copyright 2022 Airbus SAS 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, software distrib...
1.566781
2
services/buildbot/master/txbuildbot/git.py
graingert/braid
8
6630362
from twisted.python import log from twisted.internet import defer from buildbot.process import buildstep from buildbot.steps.source import Source from buildbot.steps.source.git import Git from buildbot.status.results import SUCCESS def mungeBranch(branch): """ Remove the leading prefix, that comes from svn b...
from twisted.python import log from twisted.internet import defer from buildbot.process import buildstep from buildbot.steps.source import Source from buildbot.steps.source.git import Git from buildbot.status.results import SUCCESS def mungeBranch(branch): """ Remove the leading prefix, that comes from svn b...
en
0.943484
Remove the leading prefix, that comes from svn branches. Is the branch trunk? Is the branch a release branch? Is this branch a safe branch? That is, is it on a real branch? Merge with trunk. Temporary support for the transitionary stage between SVN and Git.
2.245015
2
selfdrive/mapd/geo_util.py
openpilotkr/hikee9123
2
6630363
import numbers import math class GeoUtil: @staticmethod def degree2radius(degree): return degree * (math.pi/180) @staticmethod def get_harversion_distance(x1,y1, x2,y2, round_decimal_digits=5): """ 경위도 (x1,y1)과 (x2,y2) 점의 거리를 반환 harversion formula 이용하여 2개의 경위도간 거리를 구함(단위:km) """ if ...
import numbers import math class GeoUtil: @staticmethod def degree2radius(degree): return degree * (math.pi/180) @staticmethod def get_harversion_distance(x1,y1, x2,y2, round_decimal_digits=5): """ 경위도 (x1,y1)과 (x2,y2) 점의 거리를 반환 harversion formula 이용하여 2개의 경위도간 거리를 구함(단위:km) """ if ...
ko
0.999837
경위도 (x1,y1)과 (x2,y2) 점의 거리를 반환 harversion formula 이용하여 2개의 경위도간 거리를 구함(단위:km) # 지구의 반경(단위: km) 유클리안 formula 이용하여 (x1,y1)과 (x2,y2)점의 거리를 반환 # 경도 차이 # 위도 차이
3.281254
3
pyNastran/op2/tables/ogs_grid_point_stresses/ogs_surface_stresses.py
ACea15/pyNastran
1
6630364
<reponame>ACea15/pyNastran import warnings from typing import List import numpy as np from pyNastran.op2.result_objects.op2_objects import ScalarObject, get_times_dtype from pyNastran.f06.f06_formatting import ( write_floats_10e, _eigenvalue_header) class GridPointSurfaceArray(ScalarObject): """ ' ...
import warnings from typing import List import numpy as np from pyNastran.op2.result_objects.op2_objects import ScalarObject, get_times_dtype from pyNastran.f06.f06_formatting import ( write_floats_10e, _eigenvalue_header) class GridPointSurfaceArray(ScalarObject): """ ' ...
en
0.26197
' S T R E S S E S A T G R I D P O I N T S - - S U R F A C E 5\n', '0 SURFACE X-AXIS X NORMAL(Z-AXIS) Z REFERENCE COORDINATE SYSTEM FOR SURFACE DEFINITION CID 0\n', ' GRID ELEMENT STRESSES IN SURFACE SYS...
2.184997
2
three_wolves/deep_whole_body_controller/utility/reward_utils.py
42jaylonw/rrc_2021_three_wolves
0
6630365
import numpy as np def ComputeDist(p0, p1): return np.linalg.norm(np.subtract(p1, p0)) def FVCap(v_cap, r): return max(-v_cap, min(r, v_cap)) def ComputeAcc(pos_3, time_step=0.1): assert pos_3.shape == (3, 3) vel_0 = ComputeDist(pos_3[0], pos_3[1]) / time_step vel_1 = ComputeDist(pos_3[1], pos_3[...
import numpy as np def ComputeDist(p0, p1): return np.linalg.norm(np.subtract(p1, p0)) def FVCap(v_cap, r): return max(-v_cap, min(r, v_cap)) def ComputeAcc(pos_3, time_step=0.1): assert pos_3.shape == (3, 3) vel_0 = ComputeDist(pos_3[0], pos_3[1]) / time_step vel_1 = ComputeDist(pos_3[1], pos_3[...
none
1
2.319471
2
analysis_scripts/wga_norm_and_thresh.py
SpeerLab/STORM-UI-
1
6630366
<filename>analysis_scripts/wga_norm_and_thresh.py import sys import glob import os import numpy as np import multiprocessing as mp import matplotlib.pyplot as plt import matplotlib.image as mpimg from scipy.interpolate import make_interp_spline,BSpline from scipy.stats import zscore from scipy.interpolat...
<filename>analysis_scripts/wga_norm_and_thresh.py import sys import glob import os import numpy as np import multiprocessing as mp import matplotlib.pyplot as plt import matplotlib.image as mpimg from scipy.interpolate import make_interp_spline,BSpline from scipy.stats import zscore from scipy.interpolat...
en
0.753595
Adjust the pixel values of a grayscale image such that its histogram matches that of a target image Arguments: ----------- source: np.ndarray Image to transform; the histogram is computed over the flattened array template: np.ndarray Template his...
2.483359
2
examples/codelab/generate_customer_journeys.py
miracvbasaran/PipelineDP
0
6630367
"""Generate synthetic customer journeys for PipelineDP codelab.""" from absl import app from absl import flags import enum from typing import Optional import numpy as np import pandas as pd FLAGS = flags.FLAGS flags.DEFINE_integer('n_customers', 100, 'The number of customers to simulate.') flags.DEFINE_float('conver...
"""Generate synthetic customer journeys for PipelineDP codelab.""" from absl import app from absl import flags import enum from typing import Optional import numpy as np import pandas as pd FLAGS = flags.FLAGS flags.DEFINE_integer('n_customers', 100, 'The number of customers to simulate.') flags.DEFINE_float('conver...
en
0.834285
Generate synthetic customer journeys for PipelineDP codelab. Class of available products. Class of products that can be viewed throughout a customer journey. Creates synthetic data of customer product views and conversions. Args: n_samples: Number of samples to be generated. conversion_rate: Assumed conversi...
3.162275
3
django/docs/releases/1.4.14.txt.py
roshanba/mangal
0
6630368
XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXXXX XXXXXXX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXX XXXXX XXXXXX XXXXXX XXXXX XXXXXXX XXXXXXXX XXXXXX XX XXXXXXX XXXXXXXXXXXXX XXXXX XXXXXXXX XXXX XXXXXXXX XX XXXXX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXX XXXXXXXXXXX XXX XXXXXXXXX XXXXX ...
XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXXXX XXXXXXX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXX XXXXX XXXXXX XXXXXX XXXXX XXXXXXX XXXXXXXX XXXXXX XX XXXXXXX XXXXXXXXXXXXX XXXXX XXXXXXXX XXXX XXXXXXXX XX XXXXX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXX XXXXXXXXXXX XXX XXXXXXXXX XXXXX ...
none
1
1.376586
1
pyScript_NodeManager/NodeOutput.py
Shirazbello/Pyscriptining
0
6630369
<filename>pyScript_NodeManager/NodeOutput.py from PySide2.QtWidgets import QWidget, QGridLayout, QPushButton, QComboBox, QLineEdit, QMessageBox class NodeOutput(QWidget): def __init__(self, content_widget): super(NodeOutput, self).__init__() self.content_widget = content_widget # create ...
<filename>pyScript_NodeManager/NodeOutput.py from PySide2.QtWidgets import QWidget, QGridLayout, QPushButton, QComboBox, QLineEdit, QMessageBox class NodeOutput(QWidget): def __init__(self, content_widget): super(NodeOutput, self).__init__() self.content_widget = content_widget # create ...
en
0.318761
# create UI # create all layouts # move buttons # type and label # del button # merge layouts
2.45793
2
vpv/utils/dummy_def_fields.py
Dorky-Lever/vpv
2
6630370
<gh_stars>1-10 import numpy as np import math import SimpleITK as sitk test_vector_out = '/home/neil/share/deformations_test/test_vector_def.nrrd' test_vector_out_mhd = '/home/neil/share/deformations_test/test_vector_def.mhd' def rotate_vector(vector, theta): theta = math.radians(theta) x_temp = float(vector[...
import numpy as np import math import SimpleITK as sitk test_vector_out = '/home/neil/share/deformations_test/test_vector_def.nrrd' test_vector_out_mhd = '/home/neil/share/deformations_test/test_vector_def.mhd' def rotate_vector(vector, theta): theta = math.radians(theta) x_temp = float(vector[0]) x = vec...
en
0.707365
# Make a vector field of 2 # For each slice, rotate 45 degress
3.048842
3
LinkedinController.py
DataScienceResearchPeru/linkedin-profile-scraper
56
6630371
import time import ConfigParser from SeleniumHelper import SeleniumHelper from selenium import webdriver class LinkedinController(SeleniumHelper): # CONFIG TIMEOUT = 7 data = {} mode = 'PUBLIC' SECTIONS = {} FIELDS = {} CONTAINER = {} INITIAL_URL = 'https://www.linkedin.com' LOGIN_USER_PATH = '#login-emai...
import time import ConfigParser from SeleniumHelper import SeleniumHelper from selenium import webdriver class LinkedinController(SeleniumHelper): # CONFIG TIMEOUT = 7 data = {} mode = 'PUBLIC' SECTIONS = {} FIELDS = {} CONTAINER = {} INITIAL_URL = 'https://www.linkedin.com' LOGIN_USER_PATH = '#login-emai...
en
0.412451
# CONFIG # PUBLIC # LOGGED # CODE
2.528401
3
polls/tests/__init__.py
moonfruit/yysite
0
6630372
<gh_stars>0 # -*- coding: utf-8 -*- from .modules_test import QuestionMethodTests from .views_test import QuestionIndexDetailTests, QuestionViewTests
# -*- coding: utf-8 -*- from .modules_test import QuestionMethodTests from .views_test import QuestionIndexDetailTests, QuestionViewTests
en
0.769321
# -*- coding: utf-8 -*-
1.027748
1
tests/http/test_http_status.py
fatcode/chocs
14
6630373
<gh_stars>10-100 from chocs import HttpStatus def test_http_status_str() -> None: status = HttpStatus.OK assert "200 OK" == str(status) assert 200 == int(status) def test_http_status_from_int() -> None: status = HttpStatus.from_int(200) assert "200 OK" == str(status) assert 200 == int(stat...
from chocs import HttpStatus def test_http_status_str() -> None: status = HttpStatus.OK assert "200 OK" == str(status) assert 200 == int(status) def test_http_status_from_int() -> None: status = HttpStatus.from_int(200) assert "200 OK" == str(status) assert 200 == int(status) def test_ht...
none
1
2.69313
3
present.py
davidjohnoliver/IncomeForecast
0
6630374
import sim import model import statistics from typing import List class Simulation_Presenter: def __init__(self, simulation: sim.Simulation): self._simulation = simulation @property def year_of_retirement(self): return self._simulation.year_of_retirement @property def years_serie...
import sim import model import statistics from typing import List class Simulation_Presenter: def __init__(self, simulation: sim.Simulation): self._simulation = simulation @property def year_of_retirement(self): return self._simulation.year_of_retirement @property def years_serie...
en
0.9107
Years series Spending series Salary series Accumulated RRSP series Accumulated TFSA series Accumulated total savings series # Career Years series pre-retirement Salary series pre-retirement Net income series pre-retirement RRSP contributions pre-retirement RRSP contributions pre-retirement Total savings, yearly, pre-re...
3.107785
3
tests/test_xlsx_to_json.py
open-contracting/ocdskit-web
3
6630375
<gh_stars>1-10 from tests import ViewTestCase, ViewTests class XlsxToJsonTestCase(ViewTestCase, ViewTests): url = '/to-json/' files = [ '1.1/spreadsheets/flattened.xlsx', ] def test_go_with_files(self): self.assertResults({'type': '.csv .xlsx .zip'}, {}, { 'result.json': '...
from tests import ViewTestCase, ViewTests class XlsxToJsonTestCase(ViewTestCase, ViewTests): url = '/to-json/' files = [ '1.1/spreadsheets/flattened.xlsx', ] def test_go_with_files(self): self.assertResults({'type': '.csv .xlsx .zip'}, {}, { 'result.json': 'results/unflatt...
none
1
2.245673
2
official/cv/yolov5/train.py
leelige/mindspore
77
6630376
<reponame>leelige/mindspore<filename>official/cv/yolov5/train.py # 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/licens...
# 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.792111
# 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...
1.726048
2
async_pubsub/redis_pubsub.py
abhinavsingh/async_pubsub
17
6630377
<gh_stars>10-100 # -*- coding: utf-8 -*- import io import socket import redis import hiredis from tornado.iostream import IOStream from .base import PubSubBase class RedisPubSub(PubSubBase): def __init__(self, host='127.0.0.1', port=6379, *args, **kwargs): self.host = host self.port = port ...
# -*- coding: utf-8 -*- import io import socket import redis import hiredis from tornado.iostream import IOStream from .base import PubSubBase class RedisPubSub(PubSubBase): def __init__(self, host='127.0.0.1', port=6379, *args, **kwargs): self.host = host self.port = port super(RedisP...
en
0.402193
# -*- coding: utf-8 -*- ## ## pubsub api ## ## ## socket/stream callbacks ## ## ## redis protocol parser (derived from redis-py) ## Send redis command.
2.360284
2
yampex/scaling.py
edsuom/yampex
16
6630378
<reponame>edsuom/yampex<filename>yampex/scaling.py #!/usr/bin/env python # -*- coding: utf-8 -*- # # yampex: # Yet Another Matplotlib Extension # # Copyright (C) 2017-2021 by <NAME>, # http://edsuom.com/yampex # # See edsuom.com for API documentation as well as information about # Ed's background and other projects, so...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # yampex: # Yet Another Matplotlib Extension # # Copyright (C) 2017-2021 by <NAME>, # http://edsuom.com/yampex # # See edsuom.com for API documentation as well as information about # Ed's background and other projects, software and otherwise. # # Licensed under the Apach...
en
0.831757
#!/usr/bin/env python # -*- coding: utf-8 -*- # # yampex: # Yet Another Matplotlib Extension # # Copyright (C) 2017-2021 by <NAME>, # http://edsuom.com/yampex # # See edsuom.com for API documentation as well as information about # Ed's background and other projects, software and otherwise. # # Licensed under the Apache...
3.078247
3
invenio_records_resources/services/records/results.py
FlorianCassayre/invenio-records-resources
0
6630379
# -*- coding: utf-8 -*- # # Copyright (C) 2020 CERN. # Copyright (C) 2020 Northwestern University. # # Invenio-Records-Resources is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. """Service results.""" from flask import current_app fr...
# -*- coding: utf-8 -*- # # Copyright (C) 2020 CERN. # Copyright (C) 2020 Northwestern University. # # Invenio-Records-Resources is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. """Service results.""" from flask import current_app fr...
en
0.754577
# -*- coding: utf-8 -*- # # Copyright (C) 2020 CERN. # Copyright (C) 2020 Northwestern University. # # Invenio-Records-Resources is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. Service results. Function used to provide the current hos...
2.061808
2
abstar/utils/cigar.py
briney/abstar
30
6630380
#!/usr/bin/env python # filename: cigar.py # # Copyright (c) 2020 <NAME> # License: The MIT license (http://opensource.org/licenses/MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software # and associated documentation files (the "Software"), to deal in the Software witho...
#!/usr/bin/env python # filename: cigar.py # # Copyright (c) 2020 <NAME> # License: The MIT license (http://opensource.org/licenses/MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software # and associated documentation files (the "Software"), to deal in the Software witho...
en
0.745772
#!/usr/bin/env python # filename: cigar.py # # Copyright (c) 2020 <NAME> # License: The MIT license (http://opensource.org/licenses/MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software # and associated documentation files (the "Software"), to deal in the Software withou...
2.356925
2
weather/views.py
swiftlabUAS/SwiftUTM
0
6630381
<filename>weather/views.py # from django.template.response import TemplateResponse from django.shortcuts import render from django.views.generic.base import TemplateView from .models import Reading def weather(request): data = Reading.objects.last() # TODO: Weather: Does this mean that you only get what the...
<filename>weather/views.py # from django.template.response import TemplateResponse from django.shortcuts import render from django.views.generic.base import TemplateView from .models import Reading def weather(request): data = Reading.objects.last() # TODO: Weather: Does this mean that you only get what the...
en
0.481566
# from django.template.response import TemplateResponse # TODO: Weather: Does this mean that you only get what the last user saved? # def get_context_data(self, **kwargs): # context = super(HomePageView, self).get_context_data(**kwargs) # context['latest_articles'] = Article.objects.all()[:5] # return conte...
2.365383
2
benchml/accumulator.py
rudolfspetrovs/benchml
3
6630382
<reponame>rudolfspetrovs/benchml<filename>benchml/accumulator.py<gh_stars>1-10 import json import numpy as np import scipy.stats try: import sklearn.metrics except ImportError: pass def metric_mse(yp, yt): return np.sum((yp - yt) ** 2) / yp.shape[0] def metric_rmse(yp, yt): return metric_mse(yp, y...
import json import numpy as np import scipy.stats try: import sklearn.metrics except ImportError: pass def metric_mse(yp, yt): return np.sum((yp - yt) ** 2) / yp.shape[0] def metric_rmse(yp, yt): return metric_mse(yp, yt) ** 0.5 def metric_mae(yp, yt): return np.sum(np.abs(yp - yt)) / yp.sha...
none
1
2.328197
2
app/modules/util/util.py
anderskswanson/xtensible
1
6630383
<reponame>anderskswanson/xtensible from platform import platform def osversion(): """ print the current os this module is running on Usage: !util osversion """ return platform()
from platform import platform def osversion(): """ print the current os this module is running on Usage: !util osversion """ return platform()
en
0.733475
print the current os this module is running on Usage: !util osversion
2.66023
3
setup.py
mgaitan/fortran_magic
102
6630384
<gh_stars>100-1000 # -*- coding: utf-8 -*- from setuptools import setup long_description = (open('README.rst').read() + '\n\n' + open('CHANGES.rst').read()) setup( name='fortran-magic', version='0.6.1', description='An extension for IPython that help to use Fortran in ' ...
# -*- coding: utf-8 -*- from setuptools import setup long_description = (open('README.rst').read() + '\n\n' + open('CHANGES.rst').read()) setup( name='fortran-magic', version='0.6.1', description='An extension for IPython that help to use Fortran in ' 'your interactive ...
en
0.769321
# -*- coding: utf-8 -*-
1.064155
1
accounts/migrations/0005_auto_20201121_1422.py
jordandelaney/microblog
0
6630385
# Generated by Django 3.1.3 on 2020-11-21 19:22 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('accounts', '0004_auto_20201112_1559'), ] operations = [ migrations.AlterModelManagers( name='custom...
# Generated by Django 3.1.3 on 2020-11-21 19:22 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('accounts', '0004_auto_20201112_1559'), ] operations = [ migrations.AlterModelManagers( name='custom...
en
0.819721
# Generated by Django 3.1.3 on 2020-11-21 19:22
1.719629
2
skyportal/tests/api/test_standards.py
bparazin/skyportal
52
6630386
<gh_stars>10-100 from skyportal.tests import api def test_standards(view_only_token): status, data = api( 'GET', 'internal/standards', params={ 'facility': "Keck", 'standard_type': "ESO", 'dec_filter_range_str': None, 'ra_filter_range_str': N...
from skyportal.tests import api def test_standards(view_only_token): status, data = api( 'GET', 'internal/standards', params={ 'facility': "Keck", 'standard_type': "ESO", 'dec_filter_range_str': None, 'ra_filter_range_str': None, ...
en
0.964192
# make sure we've got an HD source in here
2.408425
2
devicewipefromasset.py
jamescapen/api-scripts
0
6630387
#!/opt/mvsd/bin/python3 ## this script will take asset tags in DeviceWipeAsset.csv and using an API call ## to Snipe retrieve the serial numbers for those devices and put them in a new ## CSV, DeviceWipeSerial.csv then it takes the serial numbers from ## DeviceWipeSerial.csv and issues an API command to WS1 (Airwatch...
#!/opt/mvsd/bin/python3 ## this script will take asset tags in DeviceWipeAsset.csv and using an API call ## to Snipe retrieve the serial numbers for those devices and put them in a new ## CSV, DeviceWipeSerial.csv then it takes the serial numbers from ## DeviceWipeSerial.csv and issues an API command to WS1 (Airwatch...
en
0.745679
#!/opt/mvsd/bin/python3 ## this script will take asset tags in DeviceWipeAsset.csv and using an API call ## to Snipe retrieve the serial numbers for those devices and put them in a new ## CSV, DeviceWipeSerial.csv then it takes the serial numbers from ## DeviceWipeSerial.csv and issues an API command to WS1 (Airwatch) ...
2.69272
3
roster_scraper.py
football61/247-scraper
0
6630388
<reponame>football61/247-scraper<filename>roster_scraper.py<gh_stars>0 from selenium import webdriver from selenium.common.exceptions import NoSuchElementException import time import csv from selenium.webdriver.chrome.options import Options from random import uniform from itertools import zip_longest from bs4...
from selenium import webdriver from selenium.common.exceptions import NoSuchElementException import time import csv from selenium.webdriver.chrome.options import Options from random import uniform from itertools import zip_longest from bs4 import BeautifulSoup import requests import pandas as pd from lxml ...
none
1
3.092255
3
python/pyspark/pandas/tests/plot/test_frame_plot.py
wangyeweikuer/spark
1
6630389
# # 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...
# # 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.832947
# # 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.901068
2
main/main.py
chdb/DhammaMap1
0
6630390
# coding: utf-8 """ Initializes flask server and assigns all routes by importing modules """ import flask #import config import util from model.config import Config # NB The model module needs to be imported *after* setting CURRENT_VERSION_TIMESTAMP, # since model.ndbModelBase uses it as default value for v...
# coding: utf-8 """ Initializes flask server and assigns all routes by importing modules """ import flask #import config import util from model.config import Config # NB The model module needs to be imported *after* setting CURRENT_VERSION_TIMESTAMP, # since model.ndbModelBase uses it as default value for v...
en
0.384695
# coding: utf-8 Initializes flask server and assigns all routes by importing modules #import config # NB The model module needs to be imported *after* setting CURRENT_VERSION_TIMESTAMP, # since model.ndbModelBase uses it as default value for version_r property # pylint: disable=invalid-name # note:Flask server doesn't ...
2.158545
2
app/core/migrations/0006_example.py
Amirh-zahmatkesh/acc-back
0
6630391
<reponame>Amirh-zahmatkesh/acc-back # Generated by Django 3.0.7 on 2020-06-17 08:01 import ckeditor.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0005_faq'), ] operations = [ migrations.CreateModel( name='Ex...
# Generated by Django 3.0.7 on 2020-06-17 08:01 import ckeditor.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0005_faq'), ] operations = [ migrations.CreateModel( name='Example', fields=[ ...
en
0.829637
# Generated by Django 3.0.7 on 2020-06-17 08:01
1.943643
2
pyboids/app/flock.py
mancaf/pyboids
12
6630392
<filename>pyboids/app/flock.py """Flock class.""" import pygame import numpy as np from . import params, utils from .boid import Boid, LeaderBoid from .obstacle import Obstacle class Flock(pygame.sprite.Sprite): """Represents a set of boids that obey to certain behaviours.""" def __init__(self): supe...
<filename>pyboids/app/flock.py """Flock class.""" import pygame import numpy as np from . import params, utils from .boid import Boid, LeaderBoid from .obstacle import Obstacle class Flock(pygame.sprite.Sprite): """Represents a set of boids that obey to certain behaviours.""" def __init__(self): supe...
en
0.837065
Flock class. Represents a set of boids that obey to certain behaviours. Add a boid at pos. The type of boid is the current add_kind value. Make all normal boids seek to go to a target. Make all normal boids fly away from a target. Make all normal boids pursue a target boid with anticipation. Make all normal bo...
3.296532
3
Python/easy/0021_merge_two_sorted_lists.py
CalmScout/LeetCode
0
6630393
""" Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1->2->4, 1->3->4 Output: 1->1->2->3->4->4 """ # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x s...
""" Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1->2->4, 1->3->4 Output: 1->1->2->3->4->4 """ # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x s...
en
0.827593
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1->2->4, 1->3->4 Output: 1->1->2->3->4->4 # Definition for singly-linked list.
3.989412
4
city_game.py
AndyBourne/city_game
0
6630394
<gh_stars>0 #!/usr/bin/python3。6 # -*- coding:utf-8 -*- import numpy as np import pandas as pd import random # import statsmodels.api as sm # from statsmodels.nonparametric.kde import KDEUnivariate # from statsmodels.nonparametric import smoothers_lowess from pandas import Series, DataFrame # from patsy import dmatric...
#!/usr/bin/python3。6 # -*- coding:utf-8 -*- import numpy as np import pandas as pd import random # import statsmodels.api as sm # from statsmodels.nonparametric.kde import KDEUnivariate # from statsmodels.nonparametric import smoothers_lowess from pandas import Series, DataFrame # from patsy import dmatrices # from sk...
en
0.492131
#!/usr/bin/python3。6 # -*- coding:utf-8 -*- # import statsmodels.api as sm # from statsmodels.nonparametric.kde import KDEUnivariate # from statsmodels.nonparametric import smoothers_lowess # from patsy import dmatrices # from sklearn import datasets, svm #name = input(u"Input City Name:") # print(left_A) # print(left_...
2.666683
3
Backend/config/config.py
sebastcotd/FisiBici
0
6630395
''' config.py: modulo donde se configura la aplicación ''' from flask import Flask from flask_cors import CORS from mongoengine import connect def config_app(app): app.secret_key = 'clavesecreta' DB_URI = "mongodb+srv://Mauricio:1234@fisibici" DB_URI += ".cpmx7.mongodb.net/SistemaBicicletas?retryWrites=tr...
''' config.py: modulo donde se configura la aplicación ''' from flask import Flask from flask_cors import CORS from mongoengine import connect def config_app(app): app.secret_key = 'clavesecreta' DB_URI = "mongodb+srv://Mauricio:1234@fisibici" DB_URI += ".cpmx7.mongodb.net/SistemaBicicletas?retryWrites=tr...
es
0.888076
config.py: modulo donde se configura la aplicación
2.001259
2
src/GaIA/pkgs/nmap/nmap-6.40/zenmap/radialnet/util/integration.py
uninth/UNItools
0
6630396
<reponame>uninth/UNItools # vim: set fileencoding=utf-8 : # ***********************IMPORTANT NMAP LICENSE TERMS************************ # * * # * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is * # * also a registered trade...
# vim: set fileencoding=utf-8 : # ***********************IMPORTANT NMAP LICENSE TERMS************************ # * * # * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is * # * also a registered trademark of Insecure.Com LLC. ...
en
0.892897
# vim: set fileencoding=utf-8 : # ***********************IMPORTANT NMAP LICENSE TERMS************************ # * * # * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is * # * also a registered trademark of Insecure.Com LLC. ...
1.199422
1
AbstractFactory/Chair/MediumChair.py
ahaile505/Python_Design_Patterns
0
6630397
from .IChair import IChair class MediumChair(IChair): """The Medium Chair Concrete Class which implements the IChair interface""" def __init__(self): self._height = 60 self._width = 60 self._depth = 60 def dimensions(self): return {"width": self._width, "depth": self._de...
from .IChair import IChair class MediumChair(IChair): """The Medium Chair Concrete Class which implements the IChair interface""" def __init__(self): self._height = 60 self._width = 60 self._depth = 60 def dimensions(self): return {"width": self._width, "depth": self._de...
en
0.861634
The Medium Chair Concrete Class which implements the IChair interface
2.77532
3
opportunities/migrations/0010_opportunity_category.py
MrEscape54/CRM
0
6630398
# Generated by Django 3.1.4 on 2020-12-31 21:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('opportunities', '0009_auto_20201231_1720'), ] operations = [ migrations.AddField( model_name='opportunity', name='ca...
# Generated by Django 3.1.4 on 2020-12-31 21:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('opportunities', '0009_auto_20201231_1720'), ] operations = [ migrations.AddField( model_name='opportunity', name='ca...
en
0.809188
# Generated by Django 3.1.4 on 2020-12-31 21:56
1.629438
2
proyectoprincipal/mainapp/queue.py
diegofdoruiz/proyectowww
0
6630399
from .models import Profile, Service, Location, Specialty, Turn, LocationOnService from django.contrib.auth.models import User from django.contrib.auth.models import Group import json from django.db import transaction class Queue(): # Usuarios de tipo cajeros, no se necesitan users = User.objects.filter(group...
from .models import Profile, Service, Location, Specialty, Turn, LocationOnService from django.contrib.auth.models import User from django.contrib.auth.models import Group import json from django.db import transaction class Queue(): # Usuarios de tipo cajeros, no se necesitan users = User.objects.filter(group...
es
0.961179
# Usuarios de tipo cajeros, no se necesitan # Ventanillas que están libres #Turnos esperando la atención, ordenados por hora de legada # retorna el id del siguiente turno que debe atender un usuario # Turnos correspondientes a los servicios propios en orden de llegada # Otros turnos en orden de llegada # Proceso crític...
2.117294
2
chapter_9/sset/upload_data.py
LifeOfGame/mongodb_redis
183
6630400
import pymongo import redis handler = pymongo.MongoClient('mongodb://root:iamsuperuser@localhost').chapter_9.rank_data client = redis.Redis() rows = handler.find({}, {'_id': 0}) for row in rows: client.zadd('rank', row['user_id'], row['score'])
import pymongo import redis handler = pymongo.MongoClient('mongodb://root:iamsuperuser@localhost').chapter_9.rank_data client = redis.Redis() rows = handler.find({}, {'_id': 0}) for row in rows: client.zadd('rank', row['user_id'], row['score'])
none
1
2.398525
2
Training Modules/03 Regex/3.07 Matrix Script/solution.py
azhari33/Python3-by-practice
54
6630401
#!/bin/python3 import math import os import random import re import sys p = re.compile(r'(?<=\w)([\$\#\%\s]+)(?=\w)') dem = sys.stdin.readline().split(); r = int(dem[0]) c = int(dem[1]) rows = [l for l in sys.stdin] text = ""; for i in range(c): for j in range(r): text = text+rows[j][i] print(p.sub(' ',te...
#!/bin/python3 import math import os import random import re import sys p = re.compile(r'(?<=\w)([\$\#\%\s]+)(?=\w)') dem = sys.stdin.readline().split(); r = int(dem[0]) c = int(dem[1]) rows = [l for l in sys.stdin] text = ""; for i in range(c): for j in range(r): text = text+rows[j][i] print(p.sub(' ',te...
ru
0.224462
#!/bin/python3 #\%\s]+)(?=\w)')
2.905032
3
03-Spark DFs/08-Spark DF withColumn.py
PacktPublishing/PySpark-and-AWS-Master-Big-Data-with-PySpark-and-AWS
3
6630402
<gh_stars>1-10 # Databricks notebook source from pyspark.sql import SparkSession from pyspark.sql.functions import col, lit spark = SparkSession.builder.appName("Spark DataFrames").getOrCreate() # COMMAND ---------- df = spark.read.options(header='True', inferSchema='True').csv('/FileStore/tables/StudentData.csv') df...
# Databricks notebook source from pyspark.sql import SparkSession from pyspark.sql.functions import col, lit spark = SparkSession.builder.appName("Spark DataFrames").getOrCreate() # COMMAND ---------- df = spark.read.options(header='True', inferSchema='True').csv('/FileStore/tables/StudentData.csv') df.show() # COMM...
en
0.150757
# Databricks notebook source # COMMAND ---------- # COMMAND ---------- # COMMAND ---------- # COMMAND ---------- # COMMAND ---------- # COMMAND ---------- # COMMAND ---------- # COMMAND ---------- # COMMAND ----------
3.193572
3
sympy/physics/quantum/qft.py
shilpiprd/sympy
8,323
6630403
"""An implementation of qubits and gates acting on them. Todo: * Update docstrings. * Update tests. * Implement apply using decompose. * Implement represent using decompose or something smarter. For this to work we first have to implement represent for SWAP. * Decide if we want upper index to be inclusive in the co...
"""An implementation of qubits and gates acting on them. Todo: * Update docstrings. * Update tests. * Implement apply using decompose. * Implement represent using decompose or something smarter. For this to work we first have to implement represent for SWAP. * Decide if we want upper index to be inclusive in the co...
en
0.774068
An implementation of qubits and gates acting on them. Todo: * Update docstrings. * Update tests. * Implement apply using decompose. * Implement represent using decompose or something smarter. For this to work we first have to implement represent for SWAP. * Decide if we want upper index to be inclusive in the const...
3.288841
3
bulk_manager_django/BulkManager.py
roodrepo/bulk_manager_django
0
6630404
<reponame>roodrepo/bulk_manager_django from django.db import connection from django.db.models.query import QuerySet from typing import Any, Tuple, TypeVar, Union, Optional from default_mutable.DefaultMutable import defaultMutable TypeClass = TypeVar('TypeClass') class BulkManager: _fields : dict =...
from django.db import connection from django.db.models.query import QuerySet from typing import Any, Tuple, TypeVar, Union, Optional from default_mutable.DefaultMutable import defaultMutable TypeClass = TypeVar('TypeClass') class BulkManager: _fields : dict = {} _objects : dict = ...
en
0.83998
Performing delete according to the list passed # If the list is empty, we delete everything in the default order (FIFO) # Looping all the tables from the ordered list # Checking if table is in the current list passed to delete Kepping in memory all the parameters to perform a bulk delete later on :param obj: djang...
2.220936
2
cert_manager/_certificates.py
arcovangeest/python-cert_manager
0
6630405
<filename>cert_manager/_certificates.py # -*- coding: utf-8 -*- """Define the cert_manager._certificate.Certificates base class.""" import logging from requests.exceptions import HTTPError from ._helpers import Pending from ._endpoint import Endpoint LOGGER = logging.getLogger(__name__) class Certificates(Endpoint...
<filename>cert_manager/_certificates.py # -*- coding: utf-8 -*- """Define the cert_manager._certificate.Certificates base class.""" import logging from requests.exceptions import HTTPError from ._helpers import Pending from ._endpoint import Endpoint LOGGER = logging.getLogger(__name__) class Certificates(Endpoint...
en
0.783062
# -*- coding: utf-8 -*- Define the cert_manager._certificate.Certificates base class. Act as a superclass for all certificate-related classes. This is due to the fact that several of the API endpoints have almost identical functions, so this allows code to be shared. # for X509, Base64 encoded # for X509 Certi...
2.953892
3
cmdb/migrations/0016_delete_infs.py
Andrreww/consistency-system
1
6630406
# Generated by Django 2.0.4 on 2018-04-24 14:07 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('cmdb', '0015_auto_20180424_1404'), ] operations = [ migrations.DeleteModel( name='Infs', ), ]
# Generated by Django 2.0.4 on 2018-04-24 14:07 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('cmdb', '0015_auto_20180424_1404'), ] operations = [ migrations.DeleteModel( name='Infs', ), ]
en
0.854057
# Generated by Django 2.0.4 on 2018-04-24 14:07
1.438024
1
modules/chempy/mol2.py
dualword/pymol-open-source
636
6630407
#A* ------------------------------------------------------------------- #B* This file contains source code for the PyMOL computer program #C* copyright Schrodinger LLC. #D* ------------------------------------------------------------------- #E* It is unlawful to modify or remove this copyright notice. #F* -------------...
#A* ------------------------------------------------------------------- #B* This file contains source code for the PyMOL computer program #C* copyright Schrodinger LLC. #D* ------------------------------------------------------------------- #E* It is unlawful to modify or remove this copyright notice. #F* -------------...
en
0.443335
#A* ------------------------------------------------------------------- #B* This file contains source code for the PyMOL computer program #C* copyright Schrodinger LLC. #D* ------------------------------------------------------------------- #E* It is unlawful to modify or remove this copyright notice. #F* -------------...
1.819163
2
ddpg/critic_network.py
santhisenan/SDN_DDoS_Simulation
50
6630408
<reponame>santhisenan/SDN_DDoS_Simulation<filename>ddpg/critic_network.py import tensorflow as tf class CriticNetwork(tf.keras.Model): def __init__(self, state_dim, action_dim, h1_critic, h2_critic, h3_critic, trainable): super(CriticNetwork, self).__init__(name='critic_network') ...
import tensorflow as tf class CriticNetwork(tf.keras.Model): def __init__(self, state_dim, action_dim, h1_critic, h2_critic, h3_critic, trainable): super(CriticNetwork, self).__init__(name='critic_network') self.state_dim = state_dim self.action_dim = action_dim se...
en
0.614669
# The layers of the model # Default # activation function
2.94762
3
extract_features.py
abhimanyusethia12/InvoiceNet
0
6630409
import sys import re import pickle import pandas as pd from nltk import ngrams import argparse import datefinder from tqdm import tqdm """ FEATURES: raw_text: The raw text processed_text: The raw text of the last word in the N-gram text_pattern: The raw text, after replacing uppercas...
import sys import re import pickle import pandas as pd from nltk import ngrams import argparse import datefinder from tqdm import tqdm """ FEATURES: raw_text: The raw text processed_text: The raw text of the last word in the N-gram text_pattern: The raw text, after replacing uppercas...
en
0.7644
FEATURES: raw_text: The raw text processed_text: The raw text of the last word in the N-gram text_pattern: The raw text, after replacing uppercase characters with X, lowercase with x, numbers with 0, repeating whitespace with single wh...
3.193548
3
curt/cli.py
mittagessen/curt
0
6630410
<reponame>mittagessen/curt<filename>curt/cli.py #! /usr/bin/env python import glob import time import torch import click import os.path import random import logging import pathlib import datetime import numpy as np import torchvision.transforms as tf from PIL import Image, ImageDraw from pathlib import Path from rich....
#! /usr/bin/env python import glob import time import torch import click import os.path import random import logging import pathlib import datetime import numpy as np import torchvision.transforms as tf from PIL import Image, ImageDraw from pathlib import Path from rich.logging import RichHandler from pytorch_lightnin...
en
0.370661
#! /usr/bin/env python # raise default max image size to 20k * 20k pixels Maps baseline/region merging to a dict of merge structures. # type: ignore # for k, v in data_module.curve_train.dataset.class_mapping.items(): # click.echo(f'{k}\t{v}') #lines + #regions detectable in an image)') # for k, v in data_...
1.818252
2
python/tests/test_aWhere.py
aWhereAPI/V1-API-Code-Samples
1
6630411
<gh_stars>1-10 from unittest import TestCase import tempfile from datetime import datetime import mock from aWhere import Weather class WeatherTest(TestCase): def setUp(self): self.client = Weather(authorize=False) def test_reading_credential_file(self): with tempfile.NamedTemporaryFile() ...
from unittest import TestCase import tempfile from datetime import datetime import mock from aWhere import Weather class WeatherTest(TestCase): def setUp(self): self.client = Weather(authorize=False) def test_reading_credential_file(self): with tempfile.NamedTemporaryFile() as temp: ...
en
0.307058
#mock_post.assert_called_once_with('https://api.awhere.com/oauth/token') #mock_response.json.assert_called_once()
2.921687
3
gallery/serializers.py
glomium/elmnt.de
0
6630412
#!/usr/bin/python # ex:set fileencoding=utf-8: from __future__ import unicode_literals from rest_framework import serializers from .models import Photo class PhotoSerializer(serializers.HyperlinkedModelSerializer): image = serializers.SerializerMethodField() class Meta: model = Photo fields...
#!/usr/bin/python # ex:set fileencoding=utf-8: from __future__ import unicode_literals from rest_framework import serializers from .models import Photo class PhotoSerializer(serializers.HyperlinkedModelSerializer): image = serializers.SerializerMethodField() class Meta: model = Photo fields...
en
0.434981
#!/usr/bin/python # ex:set fileencoding=utf-8:
2.271686
2
detect.py
GuoQuanhao/Tiny-Face-Paddle
0
6630413
import numpy as np from paddle.vision import transforms from models.model import DetectionModel import paddle import trainer import json import time import cv2 num_templates = 25 nms_thresh = 0.2 prob_thresh = 0.9 templates = json.load(open('./datasets/templates.json')) templates = np.round_(np.array(templates), deci...
import numpy as np from paddle.vision import transforms from models.model import DetectionModel import paddle import trainer import json import time import cv2 num_templates = 25 nms_thresh = 0.2 prob_thresh = 0.9 templates = json.load(open('./datasets/templates.json')) templates = np.round_(np.array(templates), deci...
en
0.545512
# store bbox (x1, y1, x2, y2), score
2.2269
2
test/args/models/no_defaults.py
pvandyken/cluster_utils
0
6630414
from __future__ import absolute_import import re import test.args.models.formatters as formatters from test.args.models.common import ModelTest, update_model from typing import Any, List import attr from typing_extensions import TypedDict from kslurm.args.arg_types import FlagArg, KeywordArg, ShapeArg, TailArg from ...
from __future__ import absolute_import import re import test.args.models.formatters as formatters from test.args.models.common import ModelTest, update_model from typing import Any, List import attr from typing_extensions import TypedDict from kslurm.args.arg_types import FlagArg, KeywordArg, ShapeArg, TailArg from ...
en
0.560613
# Providing everything works # Raise Exception if missing stuff
2.217807
2
cli/tests/integrations/test_marathon.py
ArmandGrillet/dcos-cli
0
6630415
import contextlib import json import os import re import sys import threading import pytest from six.moves.BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from dcos import constants from .common import (app, assert_command, assert_lines, exec_command, list_deployments, popen_tty, ...
import contextlib import json import os import re import sys import threading import pytest from six.moves.BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from dcos import constants from .common import (app, assert_command, assert_lines, exec_command, list_deployments, popen_tty, ...
en
0.722804
# Marathon persists app versions indefinitely by ID, so pick a large # index here in case the history is long {"message":"Invalid format: \\"20:39:32.972Z\\" is malformed at \\":39:32.972Z\\""}\n { "details": [ { "errors": [ "error.expected.jsnumber" ], "path": "/cpus" } ], "mess...
1.924158
2
src/random_char_generator.py
Epicguru/PythonML
0
6630416
def run(take_input=True, line_count=10, min_chars_per_line=10, max_chars_per_line=20): print("Running the random character generator...") print("") import input_helper as ih import random # Take keyboard input, if required. if take_input: line_count = ih.get_int("Char line c...
def run(take_input=True, line_count=10, min_chars_per_line=10, max_chars_per_line=20): print("Running the random character generator...") print("") import input_helper as ih import random # Take keyboard input, if required. if take_input: line_count = ih.get_int("Char line c...
en
0.755641
# Take keyboard input, if required. # Validate input. # Populate a char array with all 256 single-byte characters. # Not really necessary, but allows for possible limit/pool of characters to choose from. # Generate random sequences of characters based on the input. # Print the lines... # And return them
4.113235
4
Year-2/Computational-math/src/labs/lab_1/iteration.py
zubrailx/University-ITMO
3
6630417
<reponame>zubrailx/University-ITMO<gh_stars>1-10 from copy import copy from modules.matrix import Matrix def solve_iterate(ma, mb, mx, diff): it_count = 0 matrix_x = Matrix().init(mx) matrix_x_prev = matrix_x while (calculate_difference(matrix_x_prev, matrix_x) >= diff or it_count == 0): matri...
from copy import copy from modules.matrix import Matrix def solve_iterate(ma, mb, mx, diff): it_count = 0 matrix_x = Matrix().init(mx) matrix_x_prev = matrix_x while (calculate_difference(matrix_x_prev, matrix_x) >= diff or it_count == 0): matrix_x_prev = matrix_x matrix_x = iterate(ma...
none
1
3.033485
3
tools/accuracy_checker/accuracy_checker/representation/quality_assessment.py
APrigarina/open_model_zoo
1,031
6630418
""" 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.850136
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...
2.114239
2
xrypto/markets/_binance.py
AlphaPerfect/Xrypto
10
6630419
# Copyright (C) 2017, Philsong <<EMAIL>> import logging import requests from .market import Market from binance.client import Client class Binance(Market): def __init__(self, pair_code): base_currency, market_currency = self.get_tradeable_pairs(pair_code) super().__init__(base_currency, market_c...
# Copyright (C) 2017, Philsong <<EMAIL>> import logging import requests from .market import Market from binance.client import Client class Binance(Market): def __init__(self, pair_code): base_currency, market_currency = self.get_tradeable_pairs(pair_code) super().__init__(base_currency, market_c...
en
0.487073
# Copyright (C) 2017, Philsong <<EMAIL>>
2.571401
3
homeassistant/components/vacuum/demo.py
sara0871/laughing--barnacle-
1
6630420
""" Demo platform for the vacuum component. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ import logging from homeassistant.components.vacuum import ( ATTR_CLEANED_AREA, SUPPORT_BATTERY, SUPPORT_CLEAN_SPOT, SUPPORT_FAN_SPEED, SUPPORT_LOC...
""" Demo platform for the vacuum component. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ import logging from homeassistant.components.vacuum import ( ATTR_CLEANED_AREA, SUPPORT_BATTERY, SUPPORT_CLEAN_SPOT, SUPPORT_FAN_SPEED, SUPPORT_LOC...
en
0.830909
Demo platform for the vacuum component. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ Set up the Demo vacuums. Representation of a demo vacuum. Initialize the vacuum. Return the name of the vacuum. No polling needed for a demo vacuum. Return true if ...
2.097162
2
views/base_api.py
Astlo/CaLiSoft
1
6630421
<reponame>Astlo/CaLiSoft from django.http.response import HttpResponse from django.views.decorators.http import require_http_methods from neomodel import UniqueProperty, DoesNotExist import json from objectmodels.Dataset import Dataset from objectmodels.License import License from neomodels import NeoFactory, ObjectF...
from django.http.response import HttpResponse from django.views.decorators.http import require_http_methods from neomodel import UniqueProperty, DoesNotExist import json from objectmodels.Dataset import Dataset from objectmodels.License import License from neomodels import NeoFactory, ObjectFactory from neomodels.Neo...
en
0.922455
# update of labels list if needed # license does not exists in db # update precedings and followings of license recursively. # new license is a follower of a following # new_license is between license and its following_license. # then its just the next follower of the current license
1.994542
2
spaceCombat/spaceCombatApp/game/behavior.py
yuriharrison/space-combat
0
6630422
from kivy.properties import * from . import utils class Behavior: def update(self): self.apply_effects() class CollisionDetectionBehavior(Behavior): def __init__(self, **kw): self._collision_ls = list() self.register_event_type('on_collision') super().__init__(**kw) d...
from kivy.properties import * from . import utils class Behavior: def update(self): self.apply_effects() class CollisionDetectionBehavior(Behavior): def __init__(self, **kw): self._collision_ls = list() self.register_event_type('on_collision') super().__init__(**kw) d...
none
1
2.865472
3
CodeIA/venv/Lib/site-packages/coremltools/converters/mil/mil/ops/defs/_utils.py
Finasty-lab/IA-Python
3
6630423
# Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause import math import coremltools.converters from coremltools.converters.mil.mil import get_new_symbol...
# Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause import math import coremltools.converters from coremltools.converters.mil.mil import get_new_symbol...
en
0.772015
# Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause Check and broadcast given input shapes. :param shape_x: tuple of int or symbols Shape of t...
2.344327
2
Doc/sphinx-examples/tutorial/going_further/src/add-trigger.py
mpartio/ecflow
11
6630424
<reponame>mpartio/ecflow #!/usr/bin/env python2.7 import os import ecflow def create_family_f1(): f1 = ecflow.Family("f1") f1.add_variable("SLEEP", 20) f1.add_task("t1") f1.add_task("t2").add_trigger("t1 eq complete") return f1 print "Creating suite definition" defs = ecflow.Defs() suite ...
#!/usr/bin/env python2.7 import os import ecflow def create_family_f1(): f1 = ecflow.Family("f1") f1.add_variable("SLEEP", 20) f1.add_task("t1") f1.add_task("t2").add_trigger("t1 eq complete") return f1 print "Creating suite definition" defs = ecflow.Defs() suite = defs.add_suite("test") ...
ru
0.174408
#!/usr/bin/env python2.7
2.490099
2
project/project/routers.py
Gerhut/django-read-write-split
0
6630425
import random class MasterSlaveRouter(object): def db_for_read(self, model, **hints): return random.choice(('slave1', 'slave2')) def db_for_write(self, model, **hints): return 'master'
import random class MasterSlaveRouter(object): def db_for_read(self, model, **hints): return random.choice(('slave1', 'slave2')) def db_for_write(self, model, **hints): return 'master'
none
1
2.769305
3
release/stubs.min/Rhino/Geometry/__init___parts/TextEntity.py
htlcnn/ironpython-stubs
182
6630426
class TextEntity(AnnotationBase,IDisposable,ISerializable): """ Represents text geometry. This class refers to the geometric element that is independent from the document. TextEntity() """ def ConstructConstObject(self,*args): """ ConstructConstObject(self: CommonObject,parentObject: objec...
class TextEntity(AnnotationBase,IDisposable,ISerializable): """ Represents text geometry. This class refers to the geometric element that is independent from the document. TextEntity() """ def ConstructConstObject(self,*args): """ ConstructConstObject(self: CommonObject,parentObject: objec...
en
0.613244
Represents text geometry. This class refers to the geometric element that is independent from the document. TextEntity() ConstructConstObject(self: CommonObject,parentObject: object,subobject_index: int) Assigns a parent object and a subobject index to this. parentObject: The parent ob...
2.402431
2
scripts/perf/alltime.py
mhbliao/rocFFT
0
6630427
#!/usr/bin/python3 import sys, getopt import numpy as np from math import * import subprocess import os import re # regexp package import shutil import tempfile usage = '''A timing script rocfft that generates a lot of data Usage: \talltime.py \t\t-b Specify binary for dload executable (optional) \t\t-i ...
#!/usr/bin/python3 import sys, getopt import numpy as np from math import * import subprocess import os import re # regexp package import shutil import tempfile usage = '''A timing script rocfft that generates a lot of data Usage: \talltime.py \t\t-b Specify binary for dload executable (optional) \t\t-i ...
en
0.578256
#!/usr/bin/python3 # regexp package A timing script rocfft that generates a lot of data Usage: \talltime.py \t\t-b Specify binary for dload executable (optional) \t\t-i Append to list of binary directories (appendable) \t\t-o Specify output directories for raw data \t\t appendab...
2.298219
2
zerver/migrations/0182_set_initial_value_is_private_flag.py
yuroitaki/zulip
4
6630428
<reponame>yuroitaki/zulip<filename>zerver/migrations/0182_set_initial_value_is_private_flag.py<gh_stars>1-10 from django.db import migrations from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor from django.db.migrations.state import StateApps from django.db.models import F def set_initial_value_...
from django.db import migrations from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor from django.db.migrations.state import StateApps from django.db.models import F def set_initial_value_of_is_private_flag( apps: StateApps, schema_editor: BaseDatabaseSchemaEditor ) -> None: UserMessage =...
en
0.791983
# Total is only used for the progress bar # Can't use [Recipient.PERSONAL, Recipient.HUDDLE] in migration files
1.980587
2
cirq/optimizers/stratify.py
lilies/Cirq
1
6630429
<reponame>lilies/Cirq # Copyright 2020 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
# Copyright 2020 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
en
0.869646
# Copyright 2020 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
2.987052
3
python_modules/dagster/dagster_tests/execution_tests/test_event_metadata.py
souterjk/dagster
0
6630430
<reponame>souterjk/dagster import pytest from dagster import ( AssetMaterialization, AssetObservation, DagsterEventType, EventMetadata, FloatMetadataEntryData, IntMetadataEntryData, PythonArtifactMetadataEntryData, TextMetadataEntryData, UrlMetadataEntryData, execute_pipeline, ...
import pytest from dagster import ( AssetMaterialization, AssetObservation, DagsterEventType, EventMetadata, FloatMetadataEntryData, IntMetadataEntryData, PythonArtifactMetadataEntryData, TextMetadataEntryData, UrlMetadataEntryData, execute_pipeline, pipeline, solid, ) fr...
en
0.715944
# type: ignore # type: ignore # type: ignore # minimum and maximum aren't checked because they depend on the type of the column # type: ignore
2.119915
2
qiskit/providers/ibmq/runtime/runtime_program.py
eggerdj/qiskit-ibmq-provider
0
6630431
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
en
0.667263
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
2.415876
2
test/selenium/src/lib/meta.py
sbilly/ggrc-core
1
6630432
<filename>test/selenium/src/lib/meta.py<gh_stars>1-10 # Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Metaclasses module""" import pytest from lib import exception from lib import constants from lib import environment class DecorateFlakyTests(type)...
<filename>test/selenium/src/lib/meta.py<gh_stars>1-10 # Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Metaclasses module""" import pytest from lib import exception from lib import constants from lib import environment class DecorateFlakyTests(type)...
en
0.811514
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> Metaclasses module # todo: this should be refactored to DecorateMethods and used with a # factory Decorates all test methods with a decorator that repeats a failed test a couple of times Requires from all m...
2.322035
2
13. File handling/Files.py
riyabhatia26/Python-Programming
3
6630433
import sys f = open(sys.argv[1],mode = 'rt', encoding='utf-8') for line in f: sys.stdout.write(line) f.close()
import sys f = open(sys.argv[1],mode = 'rt', encoding='utf-8') for line in f: sys.stdout.write(line) f.close()
none
1
2.363899
2
core/migrations/0001_initial.py
rdmaulana/covid19-dashboard-idn
0
6630434
<gh_stars>0 # Generated by Django 3.1.4 on 2020-12-23 07:55 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='covidRecord', fields=[ ('id', m...
# Generated by Django 3.1.4 on 2020-12-23 07:55 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='covidRecord', fields=[ ('id', models.AutoFi...
en
0.832646
# Generated by Django 3.1.4 on 2020-12-23 07:55
1.910882
2
ana/hismask.py
seriksen/opticks
1
6630435
#!/usr/bin/env python # # Copyright (c) 2019 Opticks Team. All Rights Reserved. # # This file is part of Opticks # (see https://bitbucket.org/simoncblyth/opticks). # # 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...
#!/usr/bin/env python # # Copyright (c) 2019 Opticks Team. All Rights Reserved. # # This file is part of Opticks # (see https://bitbucket.org/simoncblyth/opticks). # # 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...
en
0.738883
#!/usr/bin/env python # # Copyright (c) 2019 Opticks Team. All Rights Reserved. # # This file is part of Opticks # (see https://bitbucket.org/simoncblyth/opticks). # # 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 co...
2.021579
2
setup.py
energinet-singularity/singupy
0
6630436
from setuptools import setup, find_packages setup( name='singupy', url='https://github.com/energinet-singularity/singupy', packages=find_packages(exclude=['tests']), python_requires='>=3.8', install_requires=[ 'pandas>=1.4.1', 'pandasql>=0.7.3', 'Flask>=2.1.0', 'Flas...
from setuptools import setup, find_packages setup( name='singupy', url='https://github.com/energinet-singularity/singupy', packages=find_packages(exclude=['tests']), python_requires='>=3.8', install_requires=[ 'pandas>=1.4.1', 'pandasql>=0.7.3', 'Flask>=2.1.0', 'Flas...
none
1
1.14809
1
djmoney/models/fields.py
fizista/django-money
0
6630437
<reponame>fizista/django-money<gh_stars>0 from __future__ import division from django.db import models from django.conf import settings try: from django.utils.encoding import smart_unicode except ImportError: # Python 3 from django.utils.encoding import smart_text as smart_unicode from django.utils import t...
from __future__ import division from django.db import models from django.conf import settings try: from django.utils.encoding import smart_unicode except ImportError: # Python 3 from django.utils.encoding import smart_text as smart_unicode from django.utils import translation from django.db.models.signals i...
en
0.865863
# Python 3 # 'unicode' is undefined, in Python 3 # Set to True or False has a higher priority # than USE_L10N == True in the django settings file. # The variable "self.use_l10n" has three states: Converts object of type MoneyPatched on the object of type Money. # Do not change. The variable "self.use_l10n" has three st...
1.982238
2
data_proc001_type.py
abanger/DCIC2019-Concrete-Pump-Vehicles
9
6630438
<reponame>abanger/DCIC2019-Concrete-Pump-Vehicles # @author:abanger # blog: https://abanger.github.io # github: https://github.com/abanger/DCIC2019-Concrete-Pump-Vehicles # # 数据整合,未处理 import pandas as pd import os from tqdm import * path="./" data_list = os.listdir(path+'data_train/') def add_device_type(devicetyp...
# @author:abanger # blog: https://abanger.github.io # github: https://github.com/abanger/DCIC2019-Concrete-Pump-Vehicles # # 数据整合,未处理 import pandas as pd import os from tqdm import * path="./" data_list = os.listdir(path+'data_train/') def add_device_type(devicetype,lenbb): chadd = pd.DataFrame(columns = ['ZVe...
zh
0.245343
# @author:abanger # blog: https://abanger.github.io # github: https://github.com/abanger/DCIC2019-Concrete-Pump-Vehicles # # 数据整合,未处理 #插入一行 #print(devicetype)
2.473689
2
source/meta_compare/image_clasification/sls_image_classification.py
geez0219/ARC
1
6630439
<gh_stars>1-10 import fastestimator as fe import sls import torch import torch.nn as nn import torch.nn.functional as fn from fastestimator.op.numpyop.meta import Sometimes from fastestimator.op.numpyop.multivariate import HorizontalFlip, PadIfNeeded, RandomCrop from fastestimator.op.numpyop.univariate import ChannelTr...
import fastestimator as fe import sls import torch import torch.nn as nn import torch.nn.functional as fn from fastestimator.op.numpyop.meta import Sometimes from fastestimator.op.numpyop.multivariate import HorizontalFlip, PadIfNeeded, RandomCrop from fastestimator.op.numpyop.univariate import ChannelTranspose, Coarse...
en
0.741065
# prep layer # layer 1 # layer 2 # layer 3 # layer 4 # Storing kernel size as a list in case the user needs to export the model to ONNX # As ONNX doesn't support dynamic kernel size # step 1 # step 2 # step 3
2.335944
2
manage.py
Gillingham/evething
33
6630440
#!/usr/bin/env python import os import sys # Enforce Django 1.5 from django import get_version if get_version() < '1.5': print print 'ERROR: EVEthing requires Django version 1.5 or above!' print sys.exit(1) # try using cdecimal for faster Decimal type try: import cdecimal except ImportError: ...
#!/usr/bin/env python import os import sys # Enforce Django 1.5 from django import get_version if get_version() < '1.5': print print 'ERROR: EVEthing requires Django version 1.5 or above!' print sys.exit(1) # try using cdecimal for faster Decimal type try: import cdecimal except ImportError: ...
en
0.369425
#!/usr/bin/env python # Enforce Django 1.5 # try using cdecimal for faster Decimal type
1.826491
2
interpret_tools.py
AlexisNaN/BAS-PRO_plotting
0
6630441
<reponame>AlexisNaN/BAS-PRO_plotting import interpret_cdf import colorsys import sys import numpy as np from math import sqrt, asin, pi mass0_proton = 1.6726219e-27 MeV2J = 1.60218e-13 c_ = 299792458 def userselectkey(filedict, allowmulti=False): #user selects keys from a dictionary of items supplied as argument...
import interpret_cdf import colorsys import sys import numpy as np from math import sqrt, asin, pi mass0_proton = 1.6726219e-27 MeV2J = 1.60218e-13 c_ = 299792458 def userselectkey(filedict, allowmulti=False): #user selects keys from a dictionary of items supplied as argument #input is sanitised and returned...
en
0.645927
#user selects keys from a dictionary of items supplied as argument #input is sanitised and returned as a list of keys #save the selection as keys #ask the user to selet results files to plot: #sanitise the input and re-ask if necessary: #save the selection as keys #sanitise the input and re-ask if necessary: # def byte...
3.125112
3
src/data/get_processed_data.py
neerajmachinelearning/DataScienceEnd2End_EmployeeAttrition
0
6630442
<gh_stars>0 import numpy as np import pandas as pd import os def read_data(): raw_data_path = os.path.join(os.path.pardir, 'data', 'raw') working_data_path = os.path.join(raw_data_path, 'WA_Fn-UseC_-HR-Employee-Attrition.csv') work_df = pd.read_csv(working_data_path, index_col='EmployeeNumber') return ...
import numpy as np import pandas as pd import os def read_data(): raw_data_path = os.path.join(os.path.pardir, 'data', 'raw') working_data_path = os.path.join(raw_data_path, 'WA_Fn-UseC_-HR-Employee-Attrition.csv') work_df = pd.read_csv(working_data_path, index_col='EmployeeNumber') return work_df de...
none
1
3.016692
3
src/r2pyapi/utils.py
kohnakagawa/r2pyapi
0
6630443
<filename>src/r2pyapi/utils.py from typing import List def u32_to_u8_array(a: int) -> List[int]: return [ a & 0xFF, (a >> 8) & 0xFF, (a >> 16) & 0xFF, (a >> 24) & 0xFF, ] def hex_as_string(a: List[int]) -> str: return "".join(f"{i:02x}" for i in a) def hex_as_sring_pref...
<filename>src/r2pyapi/utils.py from typing import List def u32_to_u8_array(a: int) -> List[int]: return [ a & 0xFF, (a >> 8) & 0xFF, (a >> 16) & 0xFF, (a >> 24) & 0xFF, ] def hex_as_string(a: List[int]) -> str: return "".join(f"{i:02x}" for i in a) def hex_as_sring_pref...
none
1
3.058257
3
parser/fase2/team01/Grupo1/Expresiones/Primitivo.py
webdev188/tytus
35
6630444
import sys sys.path.append('../Grupo1/Instrucciones') from instruccion import * class Primitive(Instruccion): def __init__(self, type, val): self.type = type self.val = val def execute(self): return self def __repr__(self): return str(self.__dict__)
import sys sys.path.append('../Grupo1/Instrucciones') from instruccion import * class Primitive(Instruccion): def __init__(self, type, val): self.type = type self.val = val def execute(self): return self def __repr__(self): return str(self.__dict__)
none
1
2.429644
2
python/django/django-model-try/proj/settings_local.py
10sr/junks
0
6630445
# -*- mode: python -*- """ Django settings for neru project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/sett...
# -*- mode: python -*- """ Django settings for neru project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/sett...
en
0.684805
# -*- mode: python -*- Django settings for neru project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings...
1.73063
2
bubo/migrations/007.py
jaywink/name-still-wip
12
6630446
<reponame>jaywink/name-still-wip def forward(cursor): # Remove column 'power_to_write' from rooms cursor.execute(""" CREATE TABLE rooms_backup ( id INTEGER PRIMARY KEY, name text, alias text, room_id text null, title text default '', ...
def forward(cursor): # Remove column 'power_to_write' from rooms cursor.execute(""" CREATE TABLE rooms_backup ( id INTEGER PRIMARY KEY, name text, alias text, room_id text null, title text default '', icon text default '', ...
en
0.371268
# Remove column 'power_to_write' from rooms CREATE TABLE rooms_backup ( id INTEGER PRIMARY KEY, name text, alias text, room_id text null, title text default '', icon text default '', encrypted integer, public integer, ...
3.380793
3
chatterbot/adapters/input/gitter.py
lucasqiu/ChatterBot
2
6630447
<filename>chatterbot/adapters/input/gitter.py from chatterbot.adapters.input import InputAdapter from chatterbot.conversation import Statement from time import sleep import requests class Gitter(InputAdapter): """ An input adapter that allows a ChatterBot instance to get input statements from a Gitter roo...
<filename>chatterbot/adapters/input/gitter.py from chatterbot.adapters.input import InputAdapter from chatterbot.conversation import Statement from time import sleep import requests class Gitter(InputAdapter): """ An input adapter that allows a ChatterBot instance to get input statements from a Gitter roo...
en
0.765247
An input adapter that allows a ChatterBot instance to get input statements from a Gitter room. # Join the Gitter room Takes the API response data from a single message. Returns true if the chat bot should respond. Return a string that has no leading mentions. Exception raised when unexpected non-success HTT...
2.950327
3
aries_cloudagent/revocation/manager.py
zanost/aries-cloudagent-python
1
6630448
<reponame>zanost/aries-cloudagent-python """Classes to manage credential revocation.""" import json import logging from typing import Mapping, Sequence, Text from ..core.error import BaseError from ..core.profile import Profile from ..indy.issuer import IndyIssuer from ..storage.error import StorageNotFoundError from...
"""Classes to manage credential revocation.""" import json import logging from typing import Mapping, Sequence, Text from ..core.error import BaseError from ..core.profile import Profile from ..indy.issuer import IndyIssuer from ..storage.error import StorageNotFoundError from .indy import IndyRevocation from .models...
en
0.804239
Classes to manage credential revocation. Revocation manager error. Class for managing revocation operations. Initialize a RevocationManager. Args: context: The context for this revocation manager Revoke a credential by its credential exchange identifier at issue. Optionally, publish the co...
2.308015
2
aiventure/common/adventure.py
dyeo/aiventure
0
6630449
from typing import * class Adventure(object): def __init__( self, name: str = None, context: str = None, ): self.name: str = name self.context: str = context self.memory: str = '' self.actions: List[str] = [] self.results: List[str] =...
from typing import * class Adventure(object): def __init__( self, name: str = None, context: str = None, ): self.name: str = name self.context: str = context self.memory: str = '' self.actions: List[str] = [] self.results: List[str] =...
en
0.856479
The user actions and AI results in chronological order, not including the story context. :return: A list of action and result strings, interspersed, starting with the first action. The user actions and AI results in chronological order, including the story context. :return: The story context string, f...
3.761923
4
users/admin.py
KgalabiSimon/django_shopping_cart
0
6630450
<reponame>KgalabiSimon/django_shopping_cart from django.contrib import admin from .models import Customer # Register your models here. admin.site.register(Customer)
from django.contrib import admin from .models import Customer # Register your models here. admin.site.register(Customer)
en
0.968259
# Register your models here.
1.39431
1