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
sweetwaterschools.org/boundaries/bundle.py
sdrdl/sdrdl-ambry-bundles
0
6630051
<gh_stars>0 ''' ''' from ambry.bundle.loader import GeoBuildBundle class Bundle(GeoBuildBundle): ''' ''' def build(self): super(Bundle, self).build() self.build_acs_crosswalk() return True def build_acs_crosswalk(self): from ambry.geo.util...
''' ''' from ambry.bundle.loader import GeoBuildBundle class Bundle(GeoBuildBundle): ''' ''' def build(self): super(Bundle, self).build() self.build_acs_crosswalk() return True def build_acs_crosswalk(self): from ambry.geo.util import find...
en
0.652232
# Note, ogc_fid is the primary key. The id column is created by the shapefile. Generate centroids of the 2012 ACS blockgroups SELECT gvid, X(Transform(Centroid(geometry), 4326)) AS lon, Y(Transform(Centroid(geometry), 4326)) as lat, MbrM...
2.319281
2
mapproxy/source/wms.py
autra/mapproxy
347
6630052
<reponame>autra/mapproxy<filename>mapproxy/source/wms.py # This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # 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...
# This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE...
en
0.831392
# This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE...
1.658825
2
atlas/testing/stageless_acceptance/fixtures/stageless_project/driver.py
manesioz/atlas
1
6630053
<gh_stars>1-10 import foundations from foundations import set_tag from foundations_contrib.global_state import current_foundations_context from model import * set_tag('model', 'cnn') def print_words(): print(f'Job \'{current_foundations_context().job_id()}\' deployed') print('Hello World!') print_words() ...
import foundations from foundations import set_tag from foundations_contrib.global_state import current_foundations_context from model import * set_tag('model', 'cnn') def print_words(): print(f'Job \'{current_foundations_context().job_id()}\' deployed') print('Hello World!') print_words() addition_result ...
none
1
2.112657
2
capablerobot_usbhub/device.py
d-c-d/CapableRobot_USBHub_Driver
1
6630054
<filename>capablerobot_usbhub/device.py # The MIT License (MIT) # # Copyright (c) 2019 <NAME> for Capable Robot Components # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restrictio...
<filename>capablerobot_usbhub/device.py # The MIT License (MIT) # # Copyright (c) 2019 <NAME> for Capable Robot Components # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restrictio...
en
0.817432
# The MIT License (MIT) # # Copyright (c) 2019 <NAME> for Capable Robot Components # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the righ...
1.706022
2
codes/django/curso-django/webplayground/webplayground/core/views.py
crisconru/snippetshell
1
6630055
<filename>codes/django/curso-django/webplayground/webplayground/core/views.py from django.views.generic.base import TemplateView from django.shortcuts import render class HomePageView(TemplateView): template_name = "core/home.html" def get(self, request, *args, **kwargs): return render(request, self.t...
<filename>codes/django/curso-django/webplayground/webplayground/core/views.py from django.views.generic.base import TemplateView from django.shortcuts import render class HomePageView(TemplateView): template_name = "core/home.html" def get(self, request, *args, **kwargs): return render(request, self.t...
none
1
1.863384
2
lib/JumpScale/lib/perftesttools/PerfTestToolsFactory.py
rudecs/jumpscale_core7
0
6630056
from JumpScale import j from NodeNas import NodeNas from NodeHost import NodeHost from NodeMonitor import NodeMonitor from MonitorTools import * from InfluxDumper import * import os class PerfTestToolsFactory(object): """ j.tools.perftesttools.getNodeMonitor("localhost",22) make sure there is influxdb ru...
from JumpScale import j from NodeNas import NodeNas from NodeHost import NodeHost from NodeMonitor import NodeMonitor from MonitorTools import * from InfluxDumper import * import os class PerfTestToolsFactory(object): """ j.tools.perftesttools.getNodeMonitor("localhost",22) make sure there is influxdb ru...
en
0.756933
j.tools.perftesttools.getNodeMonitor("localhost",22) make sure there is influxdb running on monitor node (root/root) make sure there is redis running on monitor node with passwd as specified for example script call self.getScript() sshkey can be path to key or the private key itself the goal is...
1.635469
2
ecommerce/core/admin.py
berrondo/ecommerce
1
6630057
<reponame>berrondo/ecommerce from django.contrib import admin from .models import Order, Product, OrderItem class PickInline(admin.TabularInline): model = OrderItem extra = 1 class ProductModelAdmin(admin.ModelAdmin): list_display = ['name', 'price'] class CartModelAdmin(admin.ModelAdmin): inlines ...
from django.contrib import admin from .models import Order, Product, OrderItem class PickInline(admin.TabularInline): model = OrderItem extra = 1 class ProductModelAdmin(admin.ModelAdmin): list_display = ['name', 'price'] class CartModelAdmin(admin.ModelAdmin): inlines = (PickInline,) admin.site....
none
1
1.896767
2
tests/test_amply.py
betterhours/pulp
1
6630058
import pulp.amply as amply from io import StringIO import unittest class AmplyTest(unittest.TestCase): def test_data(self): result = amply.Amply("param T := 4;")['T'] assert result == 4 result = amply.Amply("param T := -4;")['T'] assert result == -4 result = amply.Amply("pa...
import pulp.amply as amply from io import StringIO import unittest class AmplyTest(unittest.TestCase): def test_data(self): result = amply.Amply("param T := 4;")['T'] assert result == 4 result = amply.Amply("param T := -4;")['T'] assert result == -4 result = amply.Amply("pa...
en
0.327412
set twotups dimen 2; set twotups := (1, 2) (2, 3) (4, 2) (3, 1); set dim1 dimen 1; set dim1 := (1, 2) (2, 3) (3, 2); set twotups dimen 2; set twotups := 1 2 2 3 4 2 3 1; set days{months}; set days[Jan] := 1 2 3 4; set days[Feb] := 5 6 7 8; set days{months, day...
2.913942
3
nixpkgs_review/tests/cli_mocks.py
turboMaCk/nixpkgs-review
0
6630059
<filename>nixpkgs_review/tests/cli_mocks.py<gh_stars>0 import os from io import StringIO from tempfile import TemporaryDirectory from typing import Any, List, Optional, Tuple, Union from unittest import TestCase TEST_ROOT = os.path.dirname(os.path.realpath(__file__)) DEBUG = False class IgnoreArgument: def __rep...
<filename>nixpkgs_review/tests/cli_mocks.py<gh_stars>0 import os from io import StringIO from tempfile import TemporaryDirectory from typing import Any, List, Optional, Tuple, Union from unittest import TestCase TEST_ROOT = os.path.dirname(os.path.realpath(__file__)) DEBUG = False class IgnoreArgument: def __rep...
en
0.900056
# hack to make sure the path exists
2.360085
2
code/Flask/app.py
rexroth-unofficial-ita/cpu-monitoring-ctrlx
1
6630060
<filename>code/Flask/app.py from flask import Flask, redirect, render_template, request, session, url_for, Response from werkzeug.serving import run_simple from werkzeug.middleware.dispatcher import DispatcherMiddleware import psutil import json import platform import time import subprocess import os import sys # s...
<filename>code/Flask/app.py from flask import Flask, redirect, render_template, request, session, url_for, Response from werkzeug.serving import run_simple from werkzeug.middleware.dispatcher import DispatcherMiddleware import psutil import json import platform import time import subprocess import os import sys # s...
en
0.875952
# stdout is saved # Uploads
2.226156
2
allhub/repos/downloads.py
srinivasreddy/allhub
2
6630061
from allhub.response import Response # TODO: Downloads API is deprecated. # Write a deprecation warning. class DownloadMixin: def downloads(self, owner, repo): url = "/repos/{owner}/{repo}/downloads".format(owner=owner, repo=repo) self.response = Response(self.get(url), "Downloads") retur...
from allhub.response import Response # TODO: Downloads API is deprecated. # Write a deprecation warning. class DownloadMixin: def downloads(self, owner, repo): url = "/repos/{owner}/{repo}/downloads".format(owner=owner, repo=repo) self.response = Response(self.get(url), "Downloads") retur...
en
0.700526
# TODO: Downloads API is deprecated. # Write a deprecation warning.
2.604451
3
google-cloud-sdk/lib/surface/dns/managed_zones/create.py
bopopescu/searchparty
0
6630062
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
en
0.700752
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
2.117997
2
tests/_files/tree_network_sim_expected_results/calc_temp_drop.py
rbv83/DHNx
14
6630063
# -*- coding: utf-8 """ This script calculates the heat transfer at the consumer for a simple tree network. """ import math import os import numpy as np import pandas as pd path_file = os.path.dirname(__file__) path = os.path.abspath(os.path.join(path_file, os.pardir, os.pardir, os.pardir)) input_data = os.path.join...
# -*- coding: utf-8 """ This script calculates the heat transfer at the consumer for a simple tree network. """ import math import os import numpy as np import pandas as pd path_file = os.path.dirname(__file__) path = os.path.abspath(os.path.join(path_file, os.pardir, os.pardir, os.pardir)) input_data = os.path.join...
en
0.802065
# -*- coding: utf-8 This script calculates the heat transfer at the consumer for a simple tree network. This function is reading the data of a csv with a name given as input value # Read input data for every csv component # Constants for calculation # [°C] # [°C] # [J/kg*K] # Initialize variables of type dataframe (nee...
3.019569
3
poky-dunfell/bitbake/lib/bb/ui/teamcity.py
lacie-life/YoctoPi
14
6630064
<reponame>lacie-life/YoctoPi # # TeamCity UI Implementation # # Implements a TeamCity frontend for the BitBake utility, via service messages. # See https://www.jetbrains.com/help/teamcity/build-script-interaction-with-teamcity.html # # Based on ncurses.py and knotty.py, variously by <NAME> and <NAME> # # Copyright (C) ...
# # TeamCity UI Implementation # # Implements a TeamCity frontend for the BitBake utility, via service messages. # See https://www.jetbrains.com/help/teamcity/build-script-interaction-with-teamcity.html # # Based on ncurses.py and knotty.py, variously by <NAME> and <NAME> # # Copyright (C) 2006 Michael '<NAME> # Copyri...
en
0.720618
# # TeamCity UI Implementation # # Implements a TeamCity frontend for the BitBake utility, via service messages. # See https://www.jetbrains.com/help/teamcity/build-script-interaction-with-teamcity.html # # Based on ncurses.py and knotty.py, variously by <NAME> and <NAME> # # Copyright (C) 2006 Michael '<NAME> # Copyri...
2.277225
2
source/marathon/src/phase2_contrast.py
hawkhai/blog
1
6630065
<reponame>hawkhai/blog #encoding=utf8 import os, re, sys import cv2 import numpy as np import matplotlib.pyplot as plt from lib import kalgorithm def main(): inputfile = r"./input_images/phase2/phase2_broken.jpg" imgsrc = kalgorithm.imgRead(inputfile) kalgorithm.pltHistAndImage(imgsrc.astype(np.uint8), "p...
#encoding=utf8 import os, re, sys import cv2 import numpy as np import matplotlib.pyplot as plt from lib import kalgorithm def main(): inputfile = r"./input_images/phase2/phase2_broken.jpg" imgsrc = kalgorithm.imgRead(inputfile) kalgorithm.pltHistAndImage(imgsrc.astype(np.uint8), "phase2_broken.Original")...
id
0.244375
#encoding=utf8
2.713872
3
mmedit/models/restorers/ttsr.py
sokazaki/mmediting
2
6630066
import numbers import os.path as osp import mmcv import torch from mmedit.core import tensor2img from ..builder import build_backbone, build_component, build_loss from ..registry import MODELS from .basic_restorer import BasicRestorer @MODELS.register_module() class TTSR(BasicRestorer): """TTSR model for Refere...
import numbers import os.path as osp import mmcv import torch from mmedit.core import tensor2img from ..builder import build_backbone, build_component, build_loss from ..registry import MODELS from .basic_restorer import BasicRestorer @MODELS.register_module() class TTSR(BasicRestorer): """TTSR model for Refere...
en
0.609925
TTSR model for Reference-based Image Super-Resolution. Paper: Learning Texture Transformer Network for Image Super-Resolution. Args: generator (dict): Config for the generator. extractor (dict): Config for the extractor. transformer (dict): Config for the transformer. pixel_los...
2.138178
2
test_IPsniffer.py
eLuxUniBS/IPsniffer
0
6630067
<gh_stars>0 from ipsniffer import IPsniffer import time import datetime as dt iface = "enp0s31f6" def test_sniffer(): snffer = IPsniffer("test", iface=iface, filter="", count=3) snffer.start() snffer.p.join() assert snffer.buffer.qsize() == 3 def test_restart(): snffer = IPsniffer("test", iface...
from ipsniffer import IPsniffer import time import datetime as dt iface = "enp0s31f6" def test_sniffer(): snffer = IPsniffer("test", iface=iface, filter="", count=3) snffer.start() snffer.p.join() assert snffer.buffer.qsize() == 3 def test_restart(): snffer = IPsniffer("test", iface=iface, filt...
en
0.457361
# sniffer.kill()
2.353768
2
mars/scheduler/operands/tests/test_common_ut.py
HarshCasper/mars
2
6630068
<gh_stars>1-10 # Copyright 1999-2020 Alibaba Group Holding 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 appl...
# Copyright 1999-2020 Alibaba Group Holding 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 a...
en
0.816707
# Copyright 1999-2020 Alibaba Group Holding 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 a...
1.617286
2
pygrading/static/kernel/__main__.py
PhenomingZ/PyGrading
1
6630069
import pygrading as gg from prework import prework from run import run from postwork import postwork if __name__ == '__main__': # 创建任务对象 job = gg.Job(prework=prework, run=run, postwork=postwork) # 启动任务并配置最大线程数 job.start(max_workers=1) # 输出结果JSON串 job.print()
import pygrading as gg from prework import prework from run import run from postwork import postwork if __name__ == '__main__': # 创建任务对象 job = gg.Job(prework=prework, run=run, postwork=postwork) # 启动任务并配置最大线程数 job.start(max_workers=1) # 输出结果JSON串 job.print()
zh
0.905949
# 创建任务对象 # 启动任务并配置最大线程数 # 输出结果JSON串
2.154988
2
testing/input/customization/linktypes.py
fekblom/critic
216
6630070
import linkify class IssueLink(linkify.LinkType): def __init__(self): super(IssueLink, self).__init__("#[0-9]+") def linkify(self, word, context): return "https://issuetracker.example.com/showIssue?id=" + word[1:] IssueLink()
import linkify class IssueLink(linkify.LinkType): def __init__(self): super(IssueLink, self).__init__("#[0-9]+") def linkify(self, word, context): return "https://issuetracker.example.com/showIssue?id=" + word[1:] IssueLink()
none
1
2.545779
3
connector/revconn.py
dantmnf/ArknightsAutoHelper
2
6630071
import socket import selectors import threading import secrets import queue class ReverseConnectionHost(threading.Thread): def __init__(self, port=0): super().__init__() self.daemon = True self.listen_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.listen_so...
import socket import selectors import threading import secrets import queue class ReverseConnectionHost(threading.Thread): def __init__(self, port=0): super().__init__() self.daemon = True self.listen_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.listen_so...
en
0.12421
# print('selecting ', list(self.sel.get_map().keys()))
2.643142
3
tab_fit.py
chuckedfromspace/carspy-dash
0
6630072
import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State import dash_bootstrap_components as dbc from app import app from utils import (DEFAULT_SETTINGS_SLIT, DEFAULT_SETTINGS_FIT, downsample_synth, plot_fitting, plot...
import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State import dash_bootstrap_components as dbc from app import app from utils import (DEFAULT_SETTINGS_SLIT, DEFAULT_SETTINGS_FIT, downsample_synth, plot_fitting, plot...
en
0.659078
# slit function settings tab # fit settings tab # original signal tab # fit signal tab # disable input based on slit function # plot slit graph # update fit settings # reset slit settings # update slit settings # reset slit settings # reset the reset button n_clicks to 0 when switching between settings tabs # make the ...
2.175406
2
tensorflow_examples/lite/model_maker/core/data_util/recommendation_dataloader.py
tariapper/examples
0
6630073
<reponame>tariapper/examples # Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
en
0.667796
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
2.346763
2
wizard.py
DeXtreme/project-wizard
1
6630074
import argparse import os import subprocess from pathlib import Path from distutils import dir_util class Wizard: def __init__(self, project_dir, frontends, project_name = None, git_repo = None, backend = "api") -> None: "...
import argparse import os import subprocess from pathlib import Path from distutils import dir_util class Wizard: def __init__(self, project_dir, frontends, project_name = None, git_repo = None, backend = "api") -> None: "...
en
0.582694
Initializes project files and directories Parameters ---------- project_dir : str The path to create the project directory at frontends : [str, ...] A list of the names of the frontend projects project_name : str The name of the proje...
2.837532
3
RenderingEngine.py
Nathcat/3d-Rendering-Engine
0
6630075
<filename>RenderingEngine.py from Camera import * class Engine: def __init__(self, vertices, camera_position): self.vertices = vertices self.camera = Camera(camera_position) self.version = "0.1" def render(self): self.camera.render(self.vertices) def __str__(self): ...
<filename>RenderingEngine.py from Camera import * class Engine: def __init__(self, vertices, camera_position): self.vertices = vertices self.camera = Camera(camera_position) self.version = "0.1" def render(self): self.camera.render(self.vertices) def __str__(self): ...
none
1
2.802995
3
trace_simexp/_version.py
damar-wicaksono/trace-simexp
0
6630076
<filename>trace_simexp/_version.py # -*- coding: utf-8 -*- """ trace_simexp._version ********************* Module with version number unified across project, used in the module, setup.py, and other command line interfaces. """ __version__ = "0.5.0"
<filename>trace_simexp/_version.py # -*- coding: utf-8 -*- """ trace_simexp._version ********************* Module with version number unified across project, used in the module, setup.py, and other command line interfaces. """ __version__ = "0.5.0"
en
0.684984
# -*- coding: utf-8 -*- trace_simexp._version ********************* Module with version number unified across project, used in the module, setup.py, and other command line interfaces.
0.981718
1
programmers/lv1/12930.py
KLumy/Basic-Algorithm
1
6630077
def solution(s: str): words = s.split(" ") answer = [] for word in words: chars = list(word) for i in range(len(chars)): if i % 2 == 0: chars[i] = chars[i].upper() else: chars[i] = chars[i].lower() answer.append("".join(chars)) ...
def solution(s: str): words = s.split(" ") answer = [] for word in words: chars = list(word) for i in range(len(chars)): if i % 2 == 0: chars[i] = chars[i].upper() else: chars[i] = chars[i].lower() answer.append("".join(chars)) ...
en
0.113682
# return " ".join( # map( # lambda x: "".join( # [a.lower() if i % 2 else a.upper() for i, a in enumerate(x)] # ), # s.split(" "), # ) # )
3.745451
4
QCPU_Setup/DWave-library/dist-packages/PySMT-0.7.0-py3.7.egg/pysmt/test/test_regressions.py
cogrpar/qcpuWARE
1
6630078
# # This file is part of pySMT. # # Copyright 2014 <NAME> and <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
# # This file is part of pySMT. # # Copyright 2014 <NAME> and <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
en
0.846586
# # This file is part of pySMT. # # Copyright 2014 <NAME> and <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
1.667767
2
settings.py
Laurys2517/cueh-bot
0
6630079
bot_token = <token> #token version = '0.3' #version del bot message_limit=500
bot_token = <token> #token version = '0.3' #version del bot message_limit=500
ca
0.136474
#token #version del bot
1.096673
1
skyportal/handlers/api/instrument.py
bparazin/skyportal
52
6630080
<reponame>bparazin/skyportal from marshmallow.exceptions import ValidationError from baselayer.app.access import permissions, auth_or_token from baselayer.log import make_log from sqlalchemy.orm import joinedload from sqlalchemy.orm import sessionmaker, scoped_session from tornado.ioloop import IOLoop from healpix_alc...
from marshmallow.exceptions import ValidationError from baselayer.app.access import permissions, auth_or_token from baselayer.log import make_log from sqlalchemy.orm import joinedload from sqlalchemy.orm import sessionmaker, scoped_session from tornado.ioloop import IOLoop from healpix_alchemy import Tile from regions...
en
0.639425
# See bottom of this file for redoc docstring -- moved it there so that # it could be made an f-string. # run async --- single: description: Retrieve an instrument tags: - instruments parameters: - in: path name: instrument_id req...
2.109957
2
sdk/python/pulumi_aws_native/kinesisvideo/get_signaling_channel.py
pulumi/pulumi-aws-native
29
6630081
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
en
0.787933
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** The Amazon Resource Name (ARN) of the Kinesis Video Signaling Channel. The period of time a signaling channel retains undelivered messages before they a...
1.980823
2
bare_python/s16_2_contextlib_abstractcontextmanager.py
AndreiHondrari/python_exploration
3
6630082
<filename>bare_python/s16_2_contextlib_abstractcontextmanager.py<gh_stars>1-10 #!python3 from typing import Any from contextlib import AbstractContextManager as ACM from ut import p class A(ACM): def __init__(self) -> None: self.x = 10 def __exit__(self, *args: Any) -> None: # needs to be...
<filename>bare_python/s16_2_contextlib_abstractcontextmanager.py<gh_stars>1-10 #!python3 from typing import Any from contextlib import AbstractContextManager as ACM from ut import p class A(ACM): def __init__(self) -> None: self.x = 10 def __exit__(self, *args: Any) -> None: # needs to be...
en
0.944407
#!python3 # needs to be implemented because it's abstract in ACM
2.878039
3
odrive/Firmware/fibre/python/fibre/tcp_transport.py
kirmani/doggo
0
6630083
import sys import socket import time import traceback import fibre.protocol from fibre.utils import wait_any def noprint(x): pass class TCPTransport(fibre.protocol.StreamSource, fibre.protocol.StreamSink): def __init__(self, dest_addr, dest_port, logger): # TODO: FIXME: use IPv6 # Problem: getaddrinfo fa...
import sys import socket import time import traceback import fibre.protocol from fibre.utils import wait_any def noprint(x): pass class TCPTransport(fibre.protocol.StreamSource, fibre.protocol.StreamSink): def __init__(self, dest_addr, dest_port, logger): # TODO: FIXME: use IPv6 # Problem: getaddrinfo fa...
en
0.820568
# TODO: FIXME: use IPv6 # Problem: getaddrinfo fails if the resolver returns an # IPv4 address, but we are using AF_INET6 #family = socket.AF_INET6 if socket.has_ipv6 else socket.AF_INET # TODO: Determine the right address to use from the list # TODO: this blocks until a connection is established, or the system cancels...
2.790787
3
compute/validate_object_size.py
theri/web-measurement-tools
11
6630084
#!/usr/bin/env python3 # # Author: <NAME> (<EMAIL>) # 2018 # This script computes object sizes from a packet capture trace # and compare them to HAR and Resource Timings import os import sys import glob import subprocess import logging import csv import re import datetime import computetimings RUNDIR="../testdata/" ...
#!/usr/bin/env python3 # # Author: <NAME> (<EMAIL>) # 2018 # This script computes object sizes from a packet capture trace # and compare them to HAR and Resource Timings import os import sys import glob import subprocess import logging import csv import re import datetime import computetimings RUNDIR="../testdata/" ...
en
0.829529
#!/usr/bin/env python3 # # Author: <NAME> (<EMAIL>) # 2018 # This script computes object sizes from a packet capture trace # and compare them to HAR and Resource Timings # For debugging #ADDITIONAL_TSHARK_FILTER = " \"frame.number >= 0 and frame.number <= 1000\" " #URI_TO_DEBUG = "/c_fill,w_90,h_60,g_faces,q_70/images/...
2.287577
2
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/ccxcon/migrations/0002_auto_20160325_0407.py
osoco/better-ways-of-thinking-about-software
3
6630085
<filename>Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/ccxcon/migrations/0002_auto_20160325_0407.py<gh_stars>1-10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ccxcon', '0001_initial_ccxcon_model'),...
<filename>Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/ccxcon/migrations/0002_auto_20160325_0407.py<gh_stars>1-10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ccxcon', '0001_initial_ccxcon_model'),...
none
1
1.777399
2
LHD_Build_2022/pi.py
Welf06/Beginnner_Projects
1
6630086
import imp from math import pi print("FINDING Nth DIGIT OF PI") try: num = int(input("N = ")) except: print("Enter a valid integer!") if num > 48 or num < 0: print("Please enter a num between 0 to 48") else: print(f"{pi:.48f}"[num+1])
import imp from math import pi print("FINDING Nth DIGIT OF PI") try: num = int(input("N = ")) except: print("Enter a valid integer!") if num > 48 or num < 0: print("Please enter a num between 0 to 48") else: print(f"{pi:.48f}"[num+1])
none
1
4.248526
4
tracker.py
ppabli/awesometracker-desktop
0
6630087
from tkinter import * from tkinter import ttk import threading import sys import datetime import script import os import requests import webbrowser class MainWindow(): def __init__(self, window, frame): self.window = window self.frame = frame if window == None: self.window = Tk() self.window.minsize(2...
from tkinter import * from tkinter import ttk import threading import sys import datetime import script import os import requests import webbrowser class MainWindow(): def __init__(self, window, frame): self.window = window self.frame = frame if window == None: self.window = Tk() self.window.minsize(2...
none
1
2.884802
3
demo/python_homework/WEEK03/homework04.py
richardmyu/CS
0
6630088
# -*- coding: utf-8 -*- import math # 4.任意正整数 n 以内有多少个循环素数 # 循环素数:循环移动数位,构成的新数均为素数 # 举例:197 --> 197,971,719 # 是否素数 def is_prime(n): counter = 0 for i in range(1, n + 1): if n % i == 0: counter += 1 else: continue if counter == 2: return True else: ...
# -*- coding: utf-8 -*- import math # 4.任意正整数 n 以内有多少个循环素数 # 循环素数:循环移动数位,构成的新数均为素数 # 举例:197 --> 197,971,719 # 是否素数 def is_prime(n): counter = 0 for i in range(1, n + 1): if n % i == 0: counter += 1 else: continue if counter == 2: return True else: ...
zh
0.605694
# -*- coding: utf-8 -*- # 4.任意正整数 n 以内有多少个循环素数 # 循环素数:循环移动数位,构成的新数均为素数 # 举例:197 --> 197,971,719 # 是否素数 # 是否循环素数 # print("请输入素数") # print("---", num) # 循环素数统计 # print("cycle-prime: ", i)
3.679309
4
tests/candidates/test_candidates.py
Prabh06/fonduer
0
6630089
<filename>tests/candidates/test_candidates.py<gh_stars>0 #! /usr/bin/env python import logging import os import pytest from fonduer import Meta from fonduer.candidates import CandidateExtractor, MentionExtractor, MentionNgrams from fonduer.candidates.matchers import PersonMatcher from fonduer.candidates.mentions impo...
<filename>tests/candidates/test_candidates.py<gh_stars>0 #! /usr/bin/env python import logging import os import pytest from fonduer import Meta from fonduer.candidates import CandidateExtractor, MentionExtractor, MentionNgrams from fonduer.candidates.matchers import PersonMatcher from fonduer.candidates.mentions impo...
en
0.886225
#! /usr/bin/env python Test ngram split. # When a split_token appears in the middle of the text. # When a text ends with a split_token. # When a text starts with a split_token. # When more than one split_token appears. Test chart_start and char_end of TemporarySpan that comes from Ngrams.apply. Test extracting candidat...
2.272449
2
Basico/ex009.py
Gustavsantos/python1
0
6630090
n=int(input('Quanto você gostaria de gastar em reais?')) print('com {} voce podera comprar {:2} em dolares'.format(n,n//3.5))
n=int(input('Quanto você gostaria de gastar em reais?')) print('com {} voce podera comprar {:2} em dolares'.format(n,n//3.5))
none
1
3.740236
4
axelrod/strategies/lookerup.py
rjsu26/Axelrod
0
6630091
<reponame>rjsu26/Axelrod<gh_stars>0 from collections import namedtuple from itertools import product from typing import Any, TypeVar from axelrod.action import Action, actions_to_str, str_to_actions from axelrod.player import Player C, D = Action.C, Action.D Plays = namedtuple("Plays", "self_plays, op_plays, op_ope...
from collections import namedtuple from itertools import product from typing import Any, TypeVar from axelrod.action import Action, actions_to_str, str_to_actions from axelrod.player import Player C, D = Action.C, Action.D Plays = namedtuple("Plays", "self_plays, op_plays, op_openings") Reaction = TypeVar("Reaction...
en
0.765894
LookerUp and its children use this object to determine their next actions. It is an object that creates a table of all possible plays to a specified depth and the action to be returned for each combination of plays. The "get" method returns the appropriate response. For the table containing:: ...
3.148536
3
planetmint/web/views/base.py
liviu-lesan/planetmint
0
6630092
<reponame>liviu-lesan/planetmint # Copyright © 2020 Interplanetary Database Association e.V., # Planetmint and IPDB software contributors. # SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) # Code is Apache-2.0 and docs are CC-BY-4.0 """Common classes and methods for API handlers """ import logging from flask impo...
# Copyright © 2020 Interplanetary Database Association e.V., # Planetmint and IPDB software contributors. # SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) # Code is Apache-2.0 and docs are CC-BY-4.0 """Common classes and methods for API handlers """ import logging from flask import jsonify, request from planetm...
en
0.752243
# Copyright © 2020 Interplanetary Database Association e.V., # Planetmint and IPDB software contributors. # SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) # Code is Apache-2.0 and docs are CC-BY-4.0 Common classes and methods for API handlers Base websocket URL that is advertised to external clients. Useful w...
2.09095
2
bot/src/globibot/lib/web/handlers.py
best-coloc-ever/globibot
14
6630093
<filename>bot/src/globibot/lib/web/handlers.py from tornado.web import RequestHandler from . import constants as c class ContextHandler(RequestHandler): def initialize(self, **kwargs): for name, value in kwargs.items(): setattr(self, name, value) class SessionHandler(ContextHandler): de...
<filename>bot/src/globibot/lib/web/handlers.py from tornado.web import RequestHandler from . import constants as c class ContextHandler(RequestHandler): def initialize(self, **kwargs): for name, value in kwargs.items(): setattr(self, name, value) class SessionHandler(ContextHandler): de...
none
1
2.25122
2
world.py
ryansturmer/CraftBot
3
6630094
# gcc -std=c99 -O3 -shared -o world \ # -I src -I deps/noise deps/noise/noise.c src/world.c from ctypes import CDLL, CFUNCTYPE, c_int, c_void_p from collections import OrderedDict try: dll = CDLL('./world') except: import os os.system('gcc -std=c99 -O3 -shared -o world.dll -I src -I deps/noise deps/nois...
# gcc -std=c99 -O3 -shared -o world \ # -I src -I deps/noise deps/noise/noise.c src/world.c from ctypes import CDLL, CFUNCTYPE, c_int, c_void_p from collections import OrderedDict try: dll = CDLL('./world') except: import os os.system('gcc -std=c99 -O3 -shared -o world.dll -I src -I deps/noise deps/nois...
uk
0.132689
# gcc -std=c99 -O3 -shared -o world \ # -I src -I deps/noise deps/noise/noise.c src/world.c
2.108246
2
apps/accounts/emails.py
TransparentHealth/bluebutton-web-server
1
6630095
<reponame>TransparentHealth/bluebutton-web-server import random import logging from django.conf import settings from django.core.urlresolvers import reverse from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template logger = logging.getLogger('hhs_server.%s' % __name__) def r...
import random import logging from django.conf import settings from django.core.urlresolvers import reverse from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template logger = logging.getLogger('hhs_server.%s' % __name__) def random_secret(y=40): return ''.join(random.choi...
en
0.744263
' <P> Provide this code on the authentication screen in your browser:<br> %s </p> <p> Thank you, </p> <p> The %s Team </P> Provide this code on the authentication screen in your browser: %s Thank you, The %s Team Do not call this directly. Instead use create_sign...
2.165809
2
Demo/pdist/rcsclient.py
1byte2bytes/cpython
5
6630096
<gh_stars>1-10 """Customize this file to change the default client etc. (In general, it is probably be better to make local operation the default and to require something like an RCSSERVER environment variable to enable remote operation.) """ import string import os # These defaults don't belong here -- they should...
"""Customize this file to change the default client etc. (In general, it is probably be better to make local operation the default and to require something like an RCSSERVER environment variable to enable remote operation.) """ import string import os # These defaults don't belong here -- they should be taken from ...
en
0.857727
Customize this file to change the default client etc. (In general, it is probably be better to make local operation the default and to require something like an RCSSERVER environment variable to enable remote operation.) # These defaults don't belong here -- they should be taken from the # environment or from a hidden...
2.332536
2
tests/utils/test_utilities.py
iamchetry/DataChallenge-Fall2021
1
6630097
<filename>tests/utils/test_utilities.py import numpy as np import pytest import time from chemml.utils import list_del_indices from chemml.utils import std_datetime_str from chemml.utils import tot_exec_time_str from chemml.utils import chunk from chemml.utils import bool_formatter from chemml.utils import regression_...
<filename>tests/utils/test_utilities.py import numpy as np import pytest import time from chemml.utils import list_del_indices from chemml.utils import std_datetime_str from chemml.utils import tot_exec_time_str from chemml.utils import chunk from chemml.utils import bool_formatter from chemml.utils import regression_...
none
1
2.040728
2
api/app/models/period.py
countable-web/queue-management
0
6630098
'''Copyright 2018 Province of British Columbia 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,...
'''Copyright 2018 Province of British Columbia 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,...
en
0.863408
Copyright 2018 Province of British Columbia 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, so...
1.809609
2
hoodapp/migrations/0002_auto_20190808_0052.py
CollinsMuiruri/final-is
0
6630099
<filename>hoodapp/migrations/0002_auto_20190808_0052.py # -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-08-07 21:52 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('hoodapp', '0001_initial'), ] operatio...
<filename>hoodapp/migrations/0002_auto_20190808_0052.py # -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-08-07 21:52 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('hoodapp', '0001_initial'), ] operatio...
en
0.748387
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-08-07 21:52
1.468505
1
src/cirrus/release.py
evansde77/cirrus
12
6630100
<reponame>evansde77/cirrus<gh_stars>10-100 #!/usr/bin/env python """ _release_ Implement git cirrus release command """ import os import sys import datetime import itertools from cirrus.invoke_helpers import local import pluggage.registry from argparse import ArgumentParser from cirrus.configuration import load_con...
#!/usr/bin/env python """ _release_ Implement git cirrus release command """ import os import sys import datetime import itertools from cirrus.invoke_helpers import local import pluggage.registry from argparse import ArgumentParser from cirrus.configuration import load_configuration from cirrus.environment import r...
en
0.722685
#!/usr/bin/env python _release_ Implement git cirrus release command check only single True value in iterable # There Can Be Only One!!! _parse_version_ Parse semantic major.minor.micro version string :param version: X.Y.Z format version string :returns: dictionary containing major, minor, micro version...
2.277344
2
clean_aws/datasets/scalars.py
SamuelDiai/Dash-Website
0
6630101
<gh_stars>0 from re import S, sub from socket import CAN_RAW_RECV_OWN_MSGS import pandas as pd from tqdm import tqdm from dash_website.utils.aws_loader import load_csv DIMENSION_TO_NAME = { ("Brain", "MRI", "GreyMatterVolumes"): "BrainGreyMatterVolumes", ("Brain", "MRI", "SubcorticalVolumes"): "BrainSubcortic...
from re import S, sub from socket import CAN_RAW_RECV_OWN_MSGS import pandas as pd from tqdm import tqdm from dash_website.utils.aws_loader import load_csv DIMENSION_TO_NAME = { ("Brain", "MRI", "GreyMatterVolumes"): "BrainGreyMatterVolumes", ("Brain", "MRI", "SubcorticalVolumes"): "BrainSubcorticalVolumes", ...
none
1
1.863037
2
cyp/data/exporting.py
DaikiOnodera/pycrop-yield-prediction
93
6630102
<filename>cyp/data/exporting.py<gh_stars>10-100 import ee import ssl import time from pathlib import Path import numpy as np from .utils import load_clean_yield_data as load from .utils import get_tif_files from .. import MAJOR_STATES class MODISExporter: """ A class to export MODIS data from the Google Eart...
<filename>cyp/data/exporting.py<gh_stars>10-100 import ee import ssl import time from pathlib import Path import numpy as np from .utils import load_clean_yield_data as load from .utils import get_tif_files from .. import MAJOR_STATES class MODISExporter: """ A class to export MODIS data from the Google Eart...
en
0.796131
A class to export MODIS data from the Google Earth Engine to Google Drive Parameters ---------- locations_filepath: pathlib Path, default=Path('data/yield_data.csv') A path to the yield data collection_id: str, default='MODIS/051/MCD12Q1' The ID Earth Engine Image Collection being ...
2.657733
3
host/greatfet/util/console.py
grvvy/greatfet
328
6630103
#!/usr/bin/env python3 # # This file is part of GreatFET. # # Console I/O handling; lifted from pyserial/miniterm.py, which uses the same BSD license. # (C)2002-2017 <NAME> <<EMAIL>> # import os import sys import codecs # Python 2/3 compatible method for using raw_input, and unicode-aware chr. try: raw_inpu...
#!/usr/bin/env python3 # # This file is part of GreatFET. # # Console I/O handling; lifted from pyserial/miniterm.py, which uses the same BSD license. # (C)2002-2017 <NAME> <<EMAIL>> # import os import sys import codecs # Python 2/3 compatible method for using raw_input, and unicode-aware chr. try: raw_inpu...
en
0.69245
#!/usr/bin/env python3 # # This file is part of GreatFET. # # Console I/O handling; lifted from pyserial/miniterm.py, which uses the same BSD license. # (C)2002-2017 <NAME> <<EMAIL>> # # Python 2/3 compatible method for using raw_input, and unicode-aware chr. OS abstraction for console (input/output codec, no ech...
3.116551
3
python/pyspark/mllib/classification.py
philipphoffmann/spark
0
6630104
# # 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.542835
# # 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.920399
2
sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_services.py
pjquirk/azure-sdk-for-python
1
6630105
<filename>sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_services.py<gh_stars>1-10 # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in...
<filename>sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_services.py<gh_stars>1-10 # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in...
en
0.596284
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
1.895593
2
nlp_commons/ubound.py
manderous/struct-learning-with-flow
63
6630106
<gh_stars>10-100 # Copyright (C) 2007-2011 <NAME> # URL: <http://www.cs.famaf.unc.edu.ar/~francolq/> # For license information, see LICENSE.txt #!/usr/bin/python # Calculo de precision y recall para el topline UBOUND """ WSJ10 Cantidad de arboles: 7422.0 Medidas sumando todos los brackets: Precision: 78.8 Recal...
# Copyright (C) 2007-2011 <NAME> # URL: <http://www.cs.famaf.unc.edu.ar/~francolq/> # For license information, see LICENSE.txt #!/usr/bin/python # Calculo de precision y recall para el topline UBOUND """ WSJ10 Cantidad de arboles: 7422.0 Medidas sumando todos los brackets: Precision: 78.8 Recall: 100.0 Media ...
es
0.233402
# Copyright (C) 2007-2011 <NAME> # URL: <http://www.cs.famaf.unc.edu.ar/~francolq/> # For license information, see LICENSE.txt #!/usr/bin/python # Calculo de precision y recall para el topline UBOUND WSJ10 Cantidad de arboles: 7422.0 Medidas sumando todos los brackets: Precision: 78.8 Recall: 100.0 Media harmonic...
2.526222
3
xfel/command_line/striping.py
dperl-sol/cctbx_project
155
6630107
<reponame>dperl-sol/cctbx_project from __future__ import absolute_import, division, print_function from six.moves import range # -*- Mode: Python; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- # # LIBTBX_SET_DISPATCHER_NAME cctbx.xfel.stripe_experiment # # Given an LCLS experiment results directory and a t...
from __future__ import absolute_import, division, print_function from six.moves import range # -*- Mode: Python; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- # # LIBTBX_SET_DISPATCHER_NAME cctbx.xfel.stripe_experiment # # Given an LCLS experiment results directory and a trial, group results by # run group...
en
0.639844
# -*- Mode: Python; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- # # LIBTBX_SET_DISPATCHER_NAME cctbx.xfel.stripe_experiment # # Given an LCLS experiment results directory and a trial, group results by # run group and then distrbute each run group's results into subgroups and run # dials.combine_experimen...
2.058491
2
homeassistant/components/sensor/nederlandse_spoorwegen.py
shanbs/home-assistant
2
6630108
<filename>homeassistant/components/sensor/nederlandse_spoorwegen.py<gh_stars>1-10 """ Support for Nederlandse Spoorwegen public transport. For more details on this platform, please refer to the documentation at https://home-assistant.io/components/sensor.nederlandse_spoorwegen/ """ from datetime import datetime, timed...
<filename>homeassistant/components/sensor/nederlandse_spoorwegen.py<gh_stars>1-10 """ Support for Nederlandse Spoorwegen public transport. For more details on this platform, please refer to the documentation at https://home-assistant.io/components/sensor.nederlandse_spoorwegen/ """ from datetime import datetime, timed...
en
0.646852
Support for Nederlandse Spoorwegen public transport. For more details on this platform, please refer to the documentation at https://home-assistant.io/components/sensor.nederlandse_spoorwegen/ Set up the departure sensor. Verify the existence of the given station codes. Implementation of a NS Departure Sensor. Initial...
2.231611
2
src/onegov/swissvotes/app.py
politbuero-kampagnen/onegov-cloud
0
6630109
<filename>src/onegov/swissvotes/app.py from cached_property import cached_property from more.content_security import SELF from onegov.core import Framework from onegov.core import utils from onegov.core.framework import default_content_security_policy from onegov.file import DepotApp from onegov.form import FormApp fro...
<filename>src/onegov/swissvotes/app.py from cached_property import cached_property from more.content_security import SELF from onegov.core import Framework from onegov.core import utils from onegov.core.framework import default_content_security_policy from onegov.file import DepotApp from onegov.form import FormApp fro...
en
0.815867
The swissvotes application. Include this in your onegov.yml to serve it with onegov-server. Gets or creates the dataset in the requested format. We store the dataset using the last modified timestamp - this way, we have a version of past datasets. Note that we don't delete any old datasets....
2.24728
2
tests/conftest.py
clbarnes/ncollpyde
4
6630110
from pathlib import Path import meshio import pytest from ncollpyde import Volume test_dir = Path(__file__).resolve().parent project_dir = test_dir.parent mesh_dir = project_dir / "meshes" @pytest.fixture def mesh(): return meshio.read(str(mesh_dir / "teapot.stl")) @pytest.fixture def volume(mesh): retur...
from pathlib import Path import meshio import pytest from ncollpyde import Volume test_dir = Path(__file__).resolve().parent project_dir = test_dir.parent mesh_dir = project_dir / "meshes" @pytest.fixture def mesh(): return meshio.read(str(mesh_dir / "teapot.stl")) @pytest.fixture def volume(mesh): retur...
none
1
2.156714
2
throughput.py
mgpadalkar/pidinet
137
6630111
""" (Testing FPS) Pixel Difference Networks for Efficient Edge Detection (accepted as an ICCV 2021 oral) See paper in https://arxiv.org/abs/2108.07009 Author: <NAME>, <NAME> Date: Aug 22, 2020 """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function from...
""" (Testing FPS) Pixel Difference Networks for Efficient Edge Detection (accepted as an ICCV 2021 oral) See paper in https://arxiv.org/abs/2108.07009 Author: <NAME>, <NAME> Date: Aug 22, 2020 """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function from...
en
0.66111
(Testing FPS) Pixel Difference Networks for Efficient Edge Detection (accepted as an ICCV 2021 oral) See paper in https://arxiv.org/abs/2108.07009 Author: <NAME>, <NAME> Date: Aug 22, 2020 ### Refine args ### Create model ### Transfer to cuda devices ### Load Data
2.34552
2
src/bpp/tests/test_admin/test_wydawnictwo_ciagle.py
iplweb/bpp
0
6630112
<reponame>iplweb/bpp from django.urls import reverse from model_mommy import mommy from pbn_api.models import Publication, SentData from bpp.models import Uczelnia, const from bpp.tests import normalize_html def test_wydawnictwo_ciagle_admin_zapisz_bez_linkow( admin_app, uczelnia, wydawnictwo_ciagle, charaktery...
from django.urls import reverse from model_mommy import mommy from pbn_api.models import Publication, SentData from bpp.models import Uczelnia, const from bpp.tests import normalize_html def test_wydawnictwo_ciagle_admin_zapisz_bez_linkow( admin_app, uczelnia, wydawnictwo_ciagle, charaktery_formalne ): url ...
none
1
2.197674
2
arend/settings/__init__.py
pyprogrammerblog/Arend
0
6630113
from functools import lru_cache from arend.settings.base import Settings @lru_cache def get_settings(): return Settings(**map_secrets) settings = get_settings()
from functools import lru_cache from arend.settings.base import Settings @lru_cache def get_settings(): return Settings(**map_secrets) settings = get_settings()
none
1
1.537509
2
Python/Math/Mod Divmod/mod_divmod.py
brianchiang-tw/HackerRank
2
6630114
# Enter your code here. Read input from STDIN. Print output to STDOUT if __name__ == '__main__': x, y = int( input() ), int( input() ) qr_tuple = divmod(x, y) print( f'{qr_tuple[0]}\n{qr_tuple[1]}\n{qr_tuple}')
# Enter your code here. Read input from STDIN. Print output to STDOUT if __name__ == '__main__': x, y = int( input() ), int( input() ) qr_tuple = divmod(x, y) print( f'{qr_tuple[0]}\n{qr_tuple[1]}\n{qr_tuple}')
en
0.824269
# Enter your code here. Read input from STDIN. Print output to STDOUT
3.307955
3
spider/urllib2_cookielibtest.py
fuandenghuo/100-days-of-python
0
6630115
# -*- coding: utf-8 -*- __author__ = 'abbot' import urllib2 import cookielib cookiejar = cookielib.MozillaCookieJar() cookiejar.load('cookie.txt') handler = urllib2.HTTPCookieProcessor(cookiejar) opener = urllib2.build_opener(handler) response = opener.open("http://www.baidu.com") print response.read()
# -*- coding: utf-8 -*- __author__ = 'abbot' import urllib2 import cookielib cookiejar = cookielib.MozillaCookieJar() cookiejar.load('cookie.txt') handler = urllib2.HTTPCookieProcessor(cookiejar) opener = urllib2.build_opener(handler) response = opener.open("http://www.baidu.com") print response.read()
en
0.769321
# -*- coding: utf-8 -*-
2.889963
3
setup.py
barneygale/mncrft
0
6630116
from distutils.core import setup setup( name='mncrft', version='1.0', author='<NAME>', author_email='<EMAIL>', url='https://github.com/barneygale/mncrft', license='MIT', description='Minecraft data types library', long_description=open('README.rst').read(), install_requires=['bitstr...
from distutils.core import setup setup( name='mncrft', version='1.0', author='<NAME>', author_email='<EMAIL>', url='https://github.com/barneygale/mncrft', license='MIT', description='Minecraft data types library', long_description=open('README.rst').read(), install_requires=['bitstr...
none
1
1.191564
1
src/CompilerException.py
demin-dmitriy/almost-haskell
1
6630117
class CompilerException(Exception): pass # Error raises when name collision occures or name could not be resolved class NameError(CompilerException): pass
class CompilerException(Exception): pass # Error raises when name collision occures or name could not be resolved class NameError(CompilerException): pass
en
0.868351
# Error raises when name collision occures or name could not be resolved
1.478233
1
scripts/sources/s_ens_two_scenarios.py
dpopadic/arpmRes
6
6630118
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # s_en...
en
0.431807
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # s_ens...
2.096927
2
tests/integration/test_uow.py
jeantardelli/architecture-patterns-with-python
1
6630119
<gh_stars>1-10 #pylint: disable=broad-expect import threading import time import traceback import pytest from typing import List from allocation.domain import model from allocation.service_layer import unit_of_work from ..random_refs import random_sku, random_batchref, random_orderid pytestmark = pytest.mark.usefixtur...
#pylint: disable=broad-expect import threading import time import traceback import pytest from typing import List from allocation.domain import model from allocation.service_layer import unit_of_work from ..random_refs import random_sku, random_batchref, random_orderid pytestmark = pytest.mark.usefixtures("mappers") ...
en
0.545272
#pylint: disable=broad-expect # type: List[Exception]
2.036004
2
tests/test_ion_hash_tests.py
cheqianh/ion-hash-python
1
6630120
<reponame>cheqianh/ion-hash-python<gh_stars>1-10 # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.a...
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "l...
en
0.874973
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
1.802662
2
lib/FluentDB/helpers/decorator.py
olavoasantos/FluentDB
2
6630121
from functools import wraps def decorate_all_functions(function_decorator): def decorator(cls): for name, obj in vars(cls).items(): if callable(obj): setattr(cls, name, function_decorator(obj)) return cls return decorator def beforeAfterCall(func): @wraps(fun...
from functools import wraps def decorate_all_functions(function_decorator): def decorator(cls): for name, obj in vars(cls).items(): if callable(obj): setattr(cls, name, function_decorator(obj)) return cls return decorator def beforeAfterCall(func): @wraps(fun...
en
0.914316
# before # After
3.479679
3
ntnui/apps/authentication/views/user.py
kapteinstein/tdt4290
0
6630122
<filename>ntnui/apps/authentication/views/user.py from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.views import View from django.contrib.auth import login as auth_login from authentication.forms impor...
<filename>ntnui/apps/authentication/views/user.py from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.views import View from django.contrib.auth import login as auth_login from authentication.forms impor...
en
0.521293
Returns an html template containing user settings
2.071647
2
src/opera/parser/tosca/path.py
radon-h2020/xopera-opera
0
6630123
import pathlib from .string import String class Path(String): @classmethod def build(cls, yaml_node): return cls(pathlib.PurePath(yaml_node.value), yaml_node.loc) def prefix_path(self, parent_path): if not self.data.is_absolute(): self.data = parent_path / self.data def ...
import pathlib from .string import String class Path(String): @classmethod def build(cls, yaml_node): return cls(pathlib.PurePath(yaml_node.value), yaml_node.loc) def prefix_path(self, parent_path): if not self.data.is_absolute(): self.data = parent_path / self.data def ...
en
0.941428
# Absolute path is relative to the CSAR root folder, so we need to # strip the root off of it. # Next loop removes as many path/.. pairs as possible. When the path # is in its canonical form, it should not start with .. since that # would mean that something is trying to access paths outside the # CSAR. # # Examples: #...
2.828253
3
datahub/metadata/test/test_admin.py
Staberinde/data-hub-api
6
6630124
from unittest.mock import Mock import factory import pytest from django.contrib.admin import site from django.test import RequestFactory from datahub.metadata.admin import ServiceAdmin from datahub.metadata.models import Service from datahub.metadata.test.factories import ServiceFactory @pytest.mark.django_db class...
from unittest.mock import Mock import factory import pytest from django.contrib.admin import site from django.test import RequestFactory from datahub.metadata.admin import ServiceAdmin from datahub.metadata.models import Service from datahub.metadata.test.factories import ServiceFactory @pytest.mark.django_db class...
en
0.938628
Tests for ServiceAdmin. Tests filtering by context. Test that if no filter is selected, all services are returned.
2.160292
2
gestao/recursos_humanos/models/basico/Formacao.py
Smartboxweb98/gestao_empresarial
3
6630125
# -*- coding: utf-8 -*- from django.db import models from gestao.basico.models.formacao.Curso import Curso from gestao.recursos_humanos.models.funcionario.Funcionario import Funcionario class Formacao(models.Model): funcionario = models.ForeignKey(Funcionario, verbose_name="Funcionário") curso = models.Foreig...
# -*- coding: utf-8 -*- from django.db import models from gestao.basico.models.formacao.Curso import Curso from gestao.recursos_humanos.models.funcionario.Funcionario import Funcionario class Formacao(models.Model): funcionario = models.ForeignKey(Funcionario, verbose_name="Funcionário") curso = models.Foreig...
en
0.769321
# -*- coding: utf-8 -*-
2.19984
2
src/handlers/simulation_handler/base_simulation_handler.py
superdurszlak/SubroutineTest
14
6630126
<reponame>superdurszlak/SubroutineTest import abc from Tkconstants import E, W from Tkinter import Label, Entry import config from src.utils import is_positive_float class BaseSimulationHandler: """ Base class for all simulation handlers """ def __init__(self): self._validator = None de...
import abc from Tkconstants import E, W from Tkinter import Label, Entry import config from src.utils import is_positive_float class BaseSimulationHandler: """ Base class for all simulation handlers """ def __init__(self): self._validator = None def populate(self, frame): """ ...
en
0.790115
Base class for all simulation handlers Clear frame object and populate it with handler's controls :param frame: Frame object to which UI controls will be bound :return: None Class-specific inner implementation of populate method :param frame: Frame object to which UI controls will be bound ...
3.234721
3
bot.py
w7cep/Froakie
1
6630127
<filename>bot.py<gh_stars>1-10 import os import aiohttp import nextcord import nextcord.ext from nextcord.ext import commands, tasks import platform import config # TODO: #1 Fine tune command permissions. # TODO: #2 Delete every excess space / Convert files with space indents to tabs. def main(): # allows privledge...
<filename>bot.py<gh_stars>1-10 import os import aiohttp import nextcord import nextcord.ext from nextcord.ext import commands, tasks import platform import config # TODO: #1 Fine tune command permissions. # TODO: #2 Delete every excess space / Convert files with space indents to tabs. def main(): # allows privledge...
en
0.821011
# TODO: #1 Fine tune command permissions. # TODO: #2 Delete every excess space / Convert files with space indents to tabs. # allows privledged intents for monitoring members joining, roles editing, and role assignments # boolean that will be set to true when views are added # Gets channel from internal cache # Sends ...
2.443515
2
test/conftest.py
mkauf/mod_md
0
6630128
<filename>test/conftest.py from TestEnv import TestEnv def pytest_report_header(config, startdir): TestEnv.init() return "mod_md: {version} [apache: {aversion}({prefix}), mod_{ssl}]".format( version=TestEnv.A2MD_VERSION, prefix=TestEnv.PREFIX, aversion=TestEnv.get_httpd_version(), ...
<filename>test/conftest.py from TestEnv import TestEnv def pytest_report_header(config, startdir): TestEnv.init() return "mod_md: {version} [apache: {aversion}({prefix}), mod_{ssl}]".format( version=TestEnv.A2MD_VERSION, prefix=TestEnv.PREFIX, aversion=TestEnv.get_httpd_version(), ...
none
1
1.833969
2
sandbox_request/config.py
ghga-de/sandbox-request
0
6630129
<reponame>ghga-de/sandbox-request<gh_stars>0 # Copyright 2021 Universität Tübingen, DKFZ and EMBL # for the German Human Genome-Phenome Archive (GHGA) # # 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 Lic...
# Copyright 2021 Universität Tübingen, DKFZ and EMBL # for the German Human Genome-Phenome Archive (GHGA) # # 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/license...
en
0.738792
# Copyright 2021 Universität Tübingen, DKFZ and EMBL # for the German Human Genome-Phenome Archive (GHGA) # # 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/license...
1.87253
2
dyros_jet_smach/scripts/mini_drc_mission_toplevel.py
Junhyung-Kim/dyros_jet
2
6630130
<reponame>Junhyung-Kim/dyros_jet<filename>dyros_jet_smach/scripts/mini_drc_mission_toplevel.py<gh_stars>1-10 #!/usr/bin/env python import roslib; roslib.load_manifest('dyros_jet_smach') import rospy from smach import StateMachine import smach_ros import smach from dyros_jet_msgs.msg import JointControlAction, JointCo...
#!/usr/bin/env python import roslib; roslib.load_manifest('dyros_jet_smach') import rospy from smach import StateMachine import smach_ros import smach from dyros_jet_msgs.msg import JointControlAction, JointControlGoal import rt_dynamixel_msgs.srv from actionlib import * from actionlib_msgs.msg import * from smach_ro...
en
0.349935
#!/usr/bin/env python #msg.enable = [True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False] # Construct state machine #run_mode = rospy.get_param('~run_mode', 'simulation') # Set ...
2.094778
2
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/production.py
obswork/rightstart
0
6630131
from .base import * DEBUG = False TEMPLATES[0]['OPTIONS']['debug'] = DEBUG SECRET_KEY = get_env_variable("SECRET_KEY") # Compress static files offline # http://django-compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE COMPRESS_ENABLED = True COMPRESS_OFFLINE = True COMPRESS_CSS_FI...
from .base import * DEBUG = False TEMPLATES[0]['OPTIONS']['debug'] = DEBUG SECRET_KEY = get_env_variable("SECRET_KEY") # Compress static files offline # http://django-compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE COMPRESS_ENABLED = True COMPRESS_OFFLINE = True COMPRESS_CSS_FI...
en
0.585869
# Compress static files offline # http://django-compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE # support opbeat # Send notification emails as a background task using Celery, # to prevent this from blocking web server threads # (requires the django-celery package): # http://celery.r...
1.756023
2
apps/project/views/task.py
youssriaboelseod/pyerp
115
6630132
# Django Library from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import redirect from django.urls import reverse from django.views.generic import DetailView, ListView from django.views.generic.edit import CreateView, UpdateView #...
# Django Library from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import redirect from django.urls import reverse from django.views.generic import DetailView, ListView from django.views.generic.edit import CreateView, UpdateView #...
en
0.606719
# Django Library # Localfolder Library
1.993126
2
python/tests/spatial_operator/test_point_join.py
andreicovaliov/incubator-sedona
747
6630133
# 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...
# 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...
en
0.865663
# 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...
1.631222
2
p1_basic/day16_21module/day19/03_os精讲.py
dong-pro/fullStackPython
1
6630134
# os.system("bash command") 运行shell命令,直接显示 # os.popen("bash command).read() 运行shell命令,获取执行结果 # os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径 # os.chdir("dirname") 改变当前脚本工作目录;相当于shell下cd import os # 统计文件的大小 # os.path.getsize('路径') # python的命令 # dir 路径 \C # 操作系统的命令 # 帮助你显示当前路径下的所有文件和文件夹 # os.system('dir 路径') # 使用python...
# os.system("bash command") 运行shell命令,直接显示 # os.popen("bash command).read() 运行shell命令,获取执行结果 # os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径 # os.chdir("dirname") 改变当前脚本工作目录;相当于shell下cd import os # 统计文件的大小 # os.path.getsize('路径') # python的命令 # dir 路径 \C # 操作系统的命令 # 帮助你显示当前路径下的所有文件和文件夹 # os.system('dir 路径') # 使用python...
zh
0.938121
# os.system("bash command") 运行shell命令,直接显示 # os.popen("bash command).read() 运行shell命令,获取执行结果 # os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径 # os.chdir("dirname") 改变当前脚本工作目录;相当于shell下cd # 统计文件的大小 # os.path.getsize('路径') # python的命令 # dir 路径 \C # 操作系统的命令 # 帮助你显示当前路径下的所有文件和文件夹 # os.system('dir 路径') # 使用python语言直接执行操作系统的...
2.916439
3
catkin_ws/src/00-infrastructure/easy_algo/include/easy_algo/formatting.py
yxiao1996/dev
2
6630135
from duckietown_utils import (friendly_path, indent, make_row_red, make_red, remove_table_field, format_table_plus, yaml_dump_pretty) from .algo_db import EasyAlgoFamily def format_db(db, colorize=True, verbose=False): families = list(db.family_name2config.values()) s = format_f...
from duckietown_utils import (friendly_path, indent, make_row_red, make_red, remove_table_field, format_table_plus, yaml_dump_pretty) from .algo_db import EasyAlgoFamily def format_db(db, colorize=True, verbose=False): families = list(db.family_name2config.values()) s = format_f...
none
1
2.428389
2
KGEkeras/utils.py
Erik-BM/KGE-Keras
2
6630136
import numpy as np from tqdm import tqdm from scipy.stats import rankdata from random import choice from collections import defaultdict from tensorflow.keras.callbacks import Callback from tensorflow.keras.losses import binary_crossentropy import tensorflow as tf from random import choices EPSILON = 1e-6 from rdflib...
import numpy as np from tqdm import tqdm from scipy.stats import rankdata from random import choice from collections import defaultdict from tensorflow.keras.callbacks import Callback from tensorflow.keras.losses import binary_crossentropy import tensorflow as tf from random import choices EPSILON = 1e-6 from rdflib...
es
0.410895
#') # false triples:
2.048696
2
services/backend/thiamsu/management/commands/switch.py
LKKTGB/thiamsu
10
6630137
from django.core.management.base import BaseCommand from django.db import models from thiamsu.models.translation import Translation class Command(BaseCommand): help = "Load ptt data from csv file" def add_arguments(self, parser): parser.add_argument( "--user-id", default=None, help="Targ...
from django.core.management.base import BaseCommand from django.db import models from thiamsu.models.translation import Translation class Command(BaseCommand): help = "Load ptt data from csv file" def add_arguments(self, parser): parser.add_argument( "--user-id", default=None, help="Targ...
en
0.752522
Return map {(song_id, line_no): latest_translation} of given contributor and language # save hanzi as new tailo # save tailo as new hanzi # log
2.225453
2
src/bjointsp/heuristic/heuristic.py
5GCity/5GCity-resource-placement
0
6630138
# embedding procedure import math import logging import random from collections import OrderedDict # for deterministic behavior from bjointsp.overlay.edge import Edge from bjointsp.overlay.instance import Instance from bjointsp.overlay.overlay import Overlay # global variables for easy access by all functions nodes,...
# embedding procedure import math import logging import random from collections import OrderedDict # for deterministic behavior from bjointsp.overlay.edge import Edge from bjointsp.overlay.instance import Instance from bjointsp.overlay.overlay import Overlay # global variables for easy access by all functions nodes,...
en
0.767519
# embedding procedure # for deterministic behavior # global variables for easy access by all functions # return the outgoing arc of the specified component at the specified output in the specified direction # there has to be exactly one arc per input and output; but the arc might belong to another template # remove the...
2.478832
2
berdi/Section_04_Final_Data_Merge_and_Visualization/bundle/bundle_utilites.py
iVibudh/CER-ESA-Phase2
2
6630139
<gh_stars>1-10 import os import shutil def bundle_for_project(df_index, project_folder_name, new_folder_projects, csv_file_folder, columns_index, readme_project_filepath, is_french=False): print('Start processing for project: {}'.format(project_folder_name)) if is_french: column_name_download_folder_n...
import os import shutil def bundle_for_project(df_index, project_folder_name, new_folder_projects, csv_file_folder, columns_index, readme_project_filepath, is_french=False): print('Start processing for project: {}'.format(project_folder_name)) if is_french: column_name_download_folder_name = 'Téléchar...
en
0.782464
# Create new project folder # Iterate over the table ids and create zip files of tables # Create a temporary folder in the new project folder for zipping csv files # Copy the csv files of one table to the temporary folder in the new project folder # Create a zip file of the table csvs # Delete the temporary folder afte...
3.068105
3
weblogo/logo.py
ghuls/weblogo
108
6630140
# -------------------------------- WebLogo -------------------------------- # Copyright (c) 2003-2004 The Regents of the University of California. # Copyright (c) 2005 <NAME> # Copyright (c) 2006-2015, The Regents of the University of California, through # Lawrence Berkeley National Laboratory (subject to receipt ...
# -------------------------------- WebLogo -------------------------------- # Copyright (c) 2003-2004 The Regents of the University of California. # Copyright (c) 2005 <NAME> # Copyright (c) 2006-2015, The Regents of the University of California, through # Lawrence Berkeley National Laboratory (subject to receipt ...
en
0.602681
# -------------------------------- WebLogo -------------------------------- # Copyright (c) 2003-2004 The Regents of the University of California. # Copyright (c) 2005 <NAME> # Copyright (c) 2006-2015, The Regents of the University of California, through # Lawrence Berkeley National Laboratory (subject to receipt o...
1.05893
1
appengine/swarming/server/task_scheduler.py
Slayo2008/New2
1
6630141
# Copyright 2014 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """High level tasks execution scheduling API. This is the interface closest to the HTTP handlers. """ import datetime import logging import math...
# Copyright 2014 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """High level tasks execution scheduling API. This is the interface closest to the HTTP handlers. """ import datetime import logging import math...
en
0.908832
# Copyright 2014 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. High level tasks execution scheduling API. This is the interface closest to the HTTP handlers. ### Private stuff. Converts a seconds value in floa...
2.052392
2
pororo/models/brainOCR/modules/feature_extraction.py
jayten42/pororo
1,137
6630142
import torch.nn as nn class VGGFeatureExtractor(nn.Module): """ FeatureExtractor of CRNN (https://arxiv.org/pdf/1507.05717.pdf) """ def __init__(self, n_input_channels: int = 1, n_output_channels: int = 512, opt2val=None): super(VGGFeatureExtractor, ...
import torch.nn as nn class VGGFeatureExtractor(nn.Module): """ FeatureExtractor of CRNN (https://arxiv.org/pdf/1507.05717.pdf) """ def __init__(self, n_input_channels: int = 1, n_output_channels: int = 512, opt2val=None): super(VGGFeatureExtractor, ...
en
0.385396
FeatureExtractor of CRNN (https://arxiv.org/pdf/1507.05717.pdf) # [64, 128, 256, 512] # 64x16x50 # 128x8x25 # 256x8x25 # 256x4x25 # 512x4x25 # 512x2x25 # nn.Conv2d(self.output_channel[3], self.output_channel[3], 2, 1, 0), nn.ReLU(True)) # 512x1x24 # 512x4x50 # 64x16x50 # 128x8x25 # 256x8x25 # 256x4x25 # 512x4x25 # 512...
2.5615
3
lambeq/text2diagram/ccg_parser.py
CQCL/lambeq
131
6630143
# Copyright 2021, 2022 Cambridge Quantum Computing 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 la...
# Copyright 2021, 2022 Cambridge Quantum Computing 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 la...
en
0.710608
# Copyright 2021, 2022 Cambridge Quantum Computing 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 la...
2.306332
2
problems/max_points_in_circle.py
panc86/coding-problems
0
6630144
<gh_stars>0 # Problem # There are N given points (o to N-1) on a plane. The K-th point is located at coordinates (X[K], Y[K]) and its tag is S[K]. We want to draw a circle centered on coordinates (0, 0). The circle should not contain two points with the same tag. What is the maximum number of points that can lie inside...
# Problem # There are N given points (o to N-1) on a plane. The K-th point is located at coordinates (X[K], Y[K]) and its tag is S[K]. We want to draw a circle centered on coordinates (0, 0). The circle should not contain two points with the same tag. What is the maximum number of points that can lie inside the circle?...
en
0.847273
# Problem # There are N given points (o to N-1) on a plane. The K-th point is located at coordinates (X[K], Y[K]) and its tag is S[K]. We want to draw a circle centered on coordinates (0, 0). The circle should not contain two points with the same tag. What is the maximum number of points that can lie inside the circle?...
4.093412
4
interpreter/apps.py
fossabot/open-decision
0
6630145
<filename>interpreter/apps.py<gh_stars>0 from django.apps import AppConfig class InterpreterConfig(AppConfig): name = 'interpreter'
<filename>interpreter/apps.py<gh_stars>0 from django.apps import AppConfig class InterpreterConfig(AppConfig): name = 'interpreter'
none
1
1.317445
1
Data Structures and Algorithms/HackerRank Algo Solutions/EASY PROBLEMS/BreakingTheRecords.py
akkik04/Python-DataStructures-and-Algorithms
1
6630146
<reponame>akkik04/Python-DataStructures-and-Algorithms<filename>Data Structures and Algorithms/HackerRank Algo Solutions/EASY PROBLEMS/BreakingTheRecords.py<gh_stars>1-10 # BREAKING THE RECORDS HACKERRANK SOLUTION: # creating a function to calculate amount of times the max and min records were broken. def breakingR...
Structures and Algorithms/HackerRank Algo Solutions/EASY PROBLEMS/BreakingTheRecords.py<gh_stars>1-10 # BREAKING THE RECORDS HACKERRANK SOLUTION: # creating a function to calculate amount of times the max and min records were broken. def breakingRecords(scores): # creating variables and initially declaring t...
en
0.869266
# BREAKING THE RECORDS HACKERRANK SOLUTION: # creating a function to calculate amount of times the max and min records were broken. # creating variables and initially declaring the minimum and maximum values to the first value of the array. # creating variables to store the count for the max and min values being broken...
3.843082
4
epa/forms.py
deedee/epa-admin
0
6630147
from django.forms import ModelForm, Form, ValidationError, CharField, EmailField, PasswordInput, \ IntegerField, HiddenInput from django.core.exceptions import FieldError from django.contrib.auth.models import User from epa.models import UploadData from EPA_Admin.settings import EPA_ALLOWABLE_FILE_TYPES, EPA_IMAGE...
from django.forms import ModelForm, Form, ValidationError, CharField, EmailField, PasswordInput, \ IntegerField, HiddenInput from django.core.exceptions import FieldError from django.contrib.auth.models import User from epa.models import UploadData from EPA_Admin.settings import EPA_ALLOWABLE_FILE_TYPES, EPA_IMAGE...
en
0.747174
Validate email field Other validation rules before we save it
2.276741
2
Assignments/Dictionaries/Exercise/10. SoftUni Exam Results.py
KaloyankerR/python-fundamentals-repository
0
6630148
<filename>Assignments/Dictionaries/Exercise/10. SoftUni Exam Results.py<gh_stars>0 results = {} submissions = {} tokens = input() while tokens != "exam finished": tokens = tokens.split("-") user = tokens[0] language = tokens[1] if language == "banned": results.pop(user) else: poin...
<filename>Assignments/Dictionaries/Exercise/10. SoftUni Exam Results.py<gh_stars>0 results = {} submissions = {} tokens = input() while tokens != "exam finished": tokens = tokens.split("-") user = tokens[0] language = tokens[1] if language == "banned": results.pop(user) else: poin...
none
1
3.62351
4
app/tag/models.py
AndyKrivovjas/notes
0
6630149
from datetime import datetime from django.db import models from django.utils.timezone import now from app.users.models import User # Create your models here. class Tag(models.Model): name = models.CharField('name', max_length=255, default='') owner = models.ForeignKey(User, on_delete=models.CASCADE, blank=Tru...
from datetime import datetime from django.db import models from django.utils.timezone import now from app.users.models import User # Create your models here. class Tag(models.Model): name = models.CharField('name', max_length=255, default='') owner = models.ForeignKey(User, on_delete=models.CASCADE, blank=Tru...
en
0.963489
# Create your models here.
2.325248
2
Ballistics.py
Caleb68864/Scope-Cap-Chart-Generator
0
6630150
import pandas as pd from pathlib import Path import os from xlrd import open_workbook, XLRDError class Ballistics: def __init__(self, csv='./ballistics.csv', min_range=-1, max_range=-1, step=-1, range_col='Range', cols=[]): csv_file = Path(csv) if csv_file.is_file(): #print("File Foun...
import pandas as pd from pathlib import Path import os from xlrd import open_workbook, XLRDError class Ballistics: def __init__(self, csv='./ballistics.csv', min_range=-1, max_range=-1, step=-1, range_col='Range', cols=[]): csv_file = Path(csv) if csv_file.is_file(): #print("File Foun...
en
0.26886
#print("File Found") #print(filename[1], ext) #print(self.ballistics.iloc[:, cols]) # df2=df1.set_index("Range") # for index, row in df1.iterrows(): # if row[range_col] >= start_range and row[range_col] <= end_range: # print(row[range_col], row[mm_col])
3.17838
3