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
DPATrail.py
angzhang1/algorithm_thinking_graph_analysis
0
6632051
<reponame>angzhang1/algorithm_thinking_graph_analysis """ Provided code for application portion of module 1 Helper class for implementing efficient version of DPA algorithm """ # general imports import random class DPATrial: """ Simple class to encapsulate optimized trials for DPA algorithm Maintains a...
""" Provided code for application portion of module 1 Helper class for implementing efficient version of DPA algorithm """ # general imports import random class DPATrial: """ Simple class to encapsulate optimized trials for DPA algorithm Maintains a list of node numbers with multiple instances of each ...
en
0.834432
Provided code for application portion of module 1 Helper class for implementing efficient version of DPA algorithm # general imports Simple class to encapsulate optimized trials for DPA algorithm Maintains a list of node numbers with multiple instances of each number. The number of instances of each node numb...
3.417035
3
iris/worker/__main__.py
dioptra-io/iris
6
6632052
<reponame>dioptra-io/iris<gh_stars>1-10 import sys from dramatiq.cli import main if __name__ == "__main__": # Equivalent to `python -m dramatiq iris.worker.watch`. sys.argv.append("iris.worker.watch") sys.exit(main())
import sys from dramatiq.cli import main if __name__ == "__main__": # Equivalent to `python -m dramatiq iris.worker.watch`. sys.argv.append("iris.worker.watch") sys.exit(main())
en
0.321799
# Equivalent to `python -m dramatiq iris.worker.watch`.
1.40421
1
freesif/__init__.py
alessioprestileo/freesif
6
6632053
# -*- coding: utf-8 -*- # Copyright (c) 2015 <NAME> """ """ from .sequentialparser.sif2hdf5 import sif2hdf5 from .data.file import File, open_hdf5, open_sif from . import utils from . import calc __version__ = '0.1.2' __all__ = ['sif2hdf5', 'File', 'utils', 'open_hdf5', 'open_sif', 'calc']
# -*- coding: utf-8 -*- # Copyright (c) 2015 <NAME> """ """ from .sequentialparser.sif2hdf5 import sif2hdf5 from .data.file import File, open_hdf5, open_sif from . import utils from . import calc __version__ = '0.1.2' __all__ = ['sif2hdf5', 'File', 'utils', 'open_hdf5', 'open_sif', 'calc']
en
0.746348
# -*- coding: utf-8 -*- # Copyright (c) 2015 <NAME>
1.257418
1
graphs_and_plots/plt_basic.py
mayankvanani/matplotlib_graphs_templates
0
6632054
import matplotlib.pyplot as plt ## plotting x vs y where x,y = [lists] ## plt.plot([x], [y], label) ## label is key of graph x1 = [1,2,3,4] y1 = [1,8,2,4] x2 = [1,2,3,8] y2 = [10,16,13,18] plt.plot(x2,y2, label='plot_1') plt.plot(x1, y1, label='plot_2') ## labelling x axis and y axis plt.xlabel('ran...
import matplotlib.pyplot as plt ## plotting x vs y where x,y = [lists] ## plt.plot([x], [y], label) ## label is key of graph x1 = [1,2,3,4] y1 = [1,8,2,4] x2 = [1,2,3,8] y2 = [10,16,13,18] plt.plot(x2,y2, label='plot_1') plt.plot(x1, y1, label='plot_2') ## labelling x axis and y axis plt.xlabel('ran...
en
0.780192
## plotting x vs y where x,y = [lists] ## plt.plot([x], [y], label) ## label is key of graph ## labelling x axis and y axis ## title of graph ##\n is for pressing enter to write the title in new line ## this bring the labels of the plot to frontend as key of graph ## plt.show() brings the backend processed stuff to for...
3.852868
4
examples/makefig8.py
prudhvibhattiprolu/Zstats
2
6632055
#This program prints out data to *.dat files, for Fig. 8 in our paper import numpy as np from Zstats import Zdisc #WARNING: Each computation, particularly when *asimov_only* is set to False, takes a lot more time when background uncertainty is non-zero #And, the computation time increases as s/bhat (*sbyb*) gets smal...
#This program prints out data to *.dat files, for Fig. 8 in our paper import numpy as np from Zstats import Zdisc #WARNING: Each computation, particularly when *asimov_only* is set to False, takes a lot more time when background uncertainty is non-zero #And, the computation time increases as s/bhat (*sbyb*) gets smal...
en
0.727914
#This program prints out data to *.dat files, for Fig. 8 in our paper #WARNING: Each computation, particularly when *asimov_only* is set to False, takes a lot more time when background uncertainty is non-zero #And, the computation time increases as s/bhat (*sbyb*) gets smaller, and also when *s* gets larger. Not recomm...
2.118248
2
var/spack/repos/builtin/packages/uncrustify/package.py
QianJianhua1/spack
11
6632056
<reponame>QianJianhua1/spack # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Uncrustify(Package): """Source Code Beautifier for C, C++, C#...
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Uncrustify(Package): """Source Code Beautifier for C, C++, C#, ObjectiveC, Java, and other...
en
0.700599
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) Source Code Beautifier for C, C++, C#, ObjectiveC, Java, and others.
1.541952
2
coronavirus_cli/main.py
MickaelLopes/Coronavirus_Update_CLI
0
6632057
<reponame>MickaelLopes/Coronavirus_Update_CLI<filename>coronavirus_cli/main.py # !/usr/bin/env python3.7 from interface.command import RequestCommand from cleo import Application # from datarequest.global_data import GlobalData # from datarequest.utils import _find_country_row app = Application() app.add(RequestComman...
# !/usr/bin/env python3.7 from interface.command import RequestCommand from cleo import Application # from datarequest.global_data import GlobalData # from datarequest.utils import _find_country_row app = Application() app.add(RequestCommand()) if __name__ == '__main__': app.run() # g = GlobalData() # pr...
en
0.252248
# !/usr/bin/env python3.7 # from datarequest.global_data import GlobalData # from datarequest.utils import _find_country_row # g = GlobalData() # print(_find_country_row(g.soup, 'USA'))
2.295131
2
do_scripts/bot.py
schedutron/chirps
40
6632058
<reponame>schedutron/chirps<filename>do_scripts/bot.py<gh_stars>10-100 """Main bot script - bot.py For the DigitalOcean Tutorial. """ # Parts of the standard library import random import time # Installed library from lxml.html import fromstring import nltk # Used here to split paragraphs into sentences during scrapi...
"""Main bot script - bot.py For the DigitalOcean Tutorial. """ # Parts of the standard library import random import time # Installed library from lxml.html import fromstring import nltk # Used here to split paragraphs into sentences during scraping. nltk.download('punkt') import requests # Used to get the HTML sour...
en
0.78533
Main bot script - bot.py For the DigitalOcean Tutorial. # Parts of the standard library # Installed library # Used here to split paragraphs into sentences during scraping. # Used to get the HTML source of a web page to be scraped. # Local credentials file defined above # This line will be explained soon Extracts text f...
3.386288
3
scholars/utils/dynamic.py
shirishgoyal/scholars
138
6632059
<filename>scholars/utils/dynamic.py from rest_framework import serializers class DynamicFieldsModelSerializer(serializers.ModelSerializer): """ A ModelSerializer that takes an additional `fields` argument that controls which fields should be displayed. """ def __init__(self, *args, **kwargs): ...
<filename>scholars/utils/dynamic.py from rest_framework import serializers class DynamicFieldsModelSerializer(serializers.ModelSerializer): """ A ModelSerializer that takes an additional `fields` argument that controls which fields should be displayed. """ def __init__(self, *args, **kwargs): ...
en
0.786603
A ModelSerializer that takes an additional `fields` argument that controls which fields should be displayed. # Don't pass the 'fields' arg up to the superclass # Instantiate the superclass normally # Drop any fields that are not specified in the `fields` argument.
2.971777
3
geeksaga/archive/config.py
geekflow/archive
0
6632060
<filename>geeksaga/archive/config.py #!/usr/bin/python # -*- coding: utf-8 -*- """ .config ~~~~~~~~ :copyright: (c) 2014 by geeksaga. :license: MIT LICENSE 2.0, see license for more details. """ import os class Config(object): SITE_ROOT = os.path.abspath(os.path.dirname(__file__)) DB_FILE_PATH...
<filename>geeksaga/archive/config.py #!/usr/bin/python # -*- coding: utf-8 -*- """ .config ~~~~~~~~ :copyright: (c) 2014 by geeksaga. :license: MIT LICENSE 2.0, see license for more details. """ import os class Config(object): SITE_ROOT = os.path.abspath(os.path.dirname(__file__)) DB_FILE_PATH...
en
0.564975
#!/usr/bin/python # -*- coding: utf-8 -*- .config ~~~~~~~~ :copyright: (c) 2014 by geeksaga. :license: MIT LICENSE 2.0, see license for more details.
1.902356
2
setup.py
Gorilla-Lab-SCUT/gorilla-3d
6
6632061
import os import os.path as osp import sys from glob import glob from setuptools import dist, setup, find_packages, Extension from setuptools.command.build_ext import build_ext try: import torch from torch.utils.cpp_extension import CUDAExtension, CppExtension, BuildExtension EXT_TYPE = "pytorch" except Mod...
import os import os.path as osp import sys from glob import glob from setuptools import dist, setup, find_packages, Extension from setuptools.command.build_ext import build_ext try: import torch from torch.utils.cpp_extension import CUDAExtension, CppExtension, BuildExtension EXT_TYPE = "pytorch" except Mod...
none
1
1.988872
2
books/migrations/0003_remove_book_pages_book_page_count_and_more.py
nixonsparrow/BookWorm
1
6632062
# Generated by Django 4.0 on 2022-01-04 09:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('books', '0002_book_author_book_cover_link_book_isbn_book_isbn_10_and_more'), ] operations = [ migrations.RemoveField( model_name='...
# Generated by Django 4.0 on 2022-01-04 09:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('books', '0002_book_author_book_cover_link_book_isbn_book_isbn_10_and_more'), ] operations = [ migrations.RemoveField( model_name='...
en
0.833217
# Generated by Django 4.0 on 2022-01-04 09:00
1.713092
2
movies/views.py
vijay0707/REST-API-DRF
0
6632063
from django.shortcuts import render from rest_framework import viewsets from .serializers import MovieSerializer from .models import Moviedata # Create your views here. class MovieViewSet(viewsets.ModelViewSet): queryset = Moviedata.objects.all() serializer_class = MovieSerializer class ActionViewSet(views...
from django.shortcuts import render from rest_framework import viewsets from .serializers import MovieSerializer from .models import Moviedata # Create your views here. class MovieViewSet(viewsets.ModelViewSet): queryset = Moviedata.objects.all() serializer_class = MovieSerializer class ActionViewSet(views...
en
0.968116
# Create your views here.
2.01091
2
abtools/phylogeny/tree.py
menis/abtools
0
6632064
#!/usr/bin/python # filename: tree.py # # Copyright (c) 2015 <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 without r...
#!/usr/bin/python # filename: tree.py # # Copyright (c) 2015 <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 without r...
en
0.751219
#!/usr/bin/python # filename: tree.py # # Copyright (c) 2015 <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 without res...
2.347472
2
test/testLine.py
kholohan/ud953-linear-algebra
0
6632065
<gh_stars>0 # -*- coding: utf-8 -*- # Author: github.com/kholohan import unittest from vector import Vector from line import Line class LineTest(unittest.TestCase): def test_is_equal(self): # line 1: 4.046x + 2.836y = 1.21 # line 2: 10.115x + 7.09y = 3.025 line1 = Line(Vector([4.046, 2.8...
# -*- coding: utf-8 -*- # Author: github.com/kholohan import unittest from vector import Vector from line import Line class LineTest(unittest.TestCase): def test_is_equal(self): # line 1: 4.046x + 2.836y = 1.21 # line 2: 10.115x + 7.09y = 3.025 line1 = Line(Vector([4.046, 2.836]), 1.21) ...
en
0.611746
# -*- coding: utf-8 -*- # Author: github.com/kholohan # line 1: 4.046x + 2.836y = 1.21 # line 2: 10.115x + 7.09y = 3.025 # line 1: 7.204x + 3.182y = 8.68 # line 2: 8.172x + 4.114y = 9.883 # line 1: 1.182x + 5.562y = 6.744 # line 2: 1.773x + 8.343y = 9.525 # line 1: 4.046x + 2.836y = 1.21 # line 2: 10.115x + 7.09y = 3.0...
3.291733
3
python/tvm/relay/op/image/_image.py
shengxinhu/tvm
4,640
6632066
<gh_stars>1000+ # 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"...
# 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 u...
en
0.681954
# 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 u...
1.613267
2
src/tools/tool.py
zeqiufan/Distributional-Signatures
1
6632067
<reponame>zeqiufan/Distributional-Signatures import argparse import torch import numpy as np def parse_args(): parser = argparse.ArgumentParser( description="Few Shot Text Classification with Distributional Signatures") parser.add_argument("--data_path", type=str, default...
import argparse import torch import numpy as np def parse_args(): parser = argparse.ArgumentParser( description="Few Shot Text Classification with Distributional Signatures") parser.add_argument("--data_path", type=str, default="data/reuters.json", ...
en
0.169263
Print arguments (only show the relevant arguments) .---. _______ __ __ ___ | | \ ___ `'. | |/ `.' `. | | ' |--.\ \ | .-. .-. '| | | | \ ' | | | | | || | __ ...
2.749793
3
Artifacts/Results/plot_verus_losses.py
comnetsAD/ALCC
6
6632068
#-----------------------------Plot Run Commands------------------------------------# import os import numpy as np import matplotlib.pyplot as plt import sys from glob import glob import pandas as pd import seaborn as sns import math import matplotlib.gridspec as gridspec from matplotlib.patches import Ellipse plt.rcP...
#-----------------------------Plot Run Commands------------------------------------# import os import numpy as np import matplotlib.pyplot as plt import sys from glob import glob import pandas as pd import seaborn as sns import math import matplotlib.gridspec as gridspec from matplotlib.patches import Ellipse plt.rcP...
en
0.155907
#-----------------------------Plot Run Commands------------------------------------# # if float(tokens[1]) < 10000.0: # calculate the proportional values of samples
2.440152
2
lib/model/nms/seq_nms.py
YeLyuUT/FastVOD
1
6632069
# -------------------------------------------------------- # Flow-Guided Feature Aggregation # Copyright (c) 2017 Microsoft # Licensed under The MIT License [see LICENSE for details] # Modified by<NAME>, <NAME> # -------------------------------------------------------- # Based on: # MX-RCNN # Copyright (c) 2016 by Cont...
# -------------------------------------------------------- # Flow-Guided Feature Aggregation # Copyright (c) 2017 Microsoft # Licensed under The MIT License [see LICENSE for details] # Modified by<NAME>, <NAME> # -------------------------------------------------------- # Based on: # MX-RCNN # Copyright (c) 2016 by Cont...
en
0.683965
# -------------------------------------------------------- # Flow-Guided Feature Aggregation # Copyright (c) 2017 Microsoft # Licensed under The MIT License [see LICENSE for details] # Modified by<NAME>, <NAME> # -------------------------------------------------------- # Based on: # MX-RCNN # Copyright (c) 2016 by Cont...
2.23139
2
software/workflows/mde/sub_directories/core_sub_directories.py
Searchlight2/Searchlight2
17
6632070
<gh_stars>10-100 import os from misc.new_directory import new_directory def core_sub_directories(global_variables, out_path): new_directory(out_path) new_directory(os.path.join(out_path, "data")) new_directory(os.path.join(out_path, "data", "gene_IDs")) new_directory(os.path.join(out_path, "data", "ge...
import os from misc.new_directory import new_directory def core_sub_directories(global_variables, out_path): new_directory(out_path) new_directory(os.path.join(out_path, "data")) new_directory(os.path.join(out_path, "data", "gene_IDs")) new_directory(os.path.join(out_path, "data", "gene_symbols")) ...
none
1
2.364636
2
custom_components/config_flow.py
hombrelab/home-assistant-backup-state
0
6632071
# Copyright (c) 2021 Hombrelab <<EMAIL>> # Config flow for the Backup State component. import logging import voluptuous as vol from homeassistant.components import mqtt from homeassistant import config_entries, exceptions from homeassistant.config_entries import ConfigFlow from .const import ( DOMAIN, NAM...
# Copyright (c) 2021 Hombrelab <<EMAIL>> # Config flow for the Backup State component. import logging import voluptuous as vol from homeassistant.components import mqtt from homeassistant import config_entries, exceptions from homeassistant.config_entries import ConfigFlow from .const import ( DOMAIN, NAM...
en
0.685772
# Copyright (c) 2021 Hombrelab <<EMAIL>> # Config flow for the Backup State component. Error to indicate that data is not valid
2.230178
2
tests/celery_app.py
khamenman/django-logic-celery
6
6632072
<filename>tests/celery_app.py from celery import Celery app = Celery('tests') app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks()
<filename>tests/celery_app.py from celery import Celery app = Celery('tests') app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks()
none
1
1.512343
2
env/lib/python3.8/site-packages/anymail/backends/postmark.py
avdhari/enigma
0
6632073
import re from ..exceptions import AnymailRequestsAPIError from ..message import AnymailRecipientStatus from ..utils import get_anymail_setting, parse_address_list from .base_requests import AnymailRequestsBackend, RequestsPayload class EmailBackend(AnymailRequestsBackend): """ Postmark API Email Backend ...
import re from ..exceptions import AnymailRequestsAPIError from ..message import AnymailRecipientStatus from ..utils import get_anymail_setting, parse_address_list from .base_requests import AnymailRequestsBackend, RequestsPayload class EmailBackend(AnymailRequestsBackend): """ Postmark API Email Backend ...
en
0.869812
Postmark API Email Backend Init options from Django settings # We need to handle 422 responses in parse_recipient_status # default to "unknown" status for each recipient, unless/until we find otherwise # non-batch calls return a single response object # these fields should always be present # At least partial success, ...
2.286587
2
gitlab2prov/pipelines.py
DLR-SC/gitlab2prov
13
6632074
from typing import List, Tuple from prov.model import ProvDocument from gitlab2prov.api import GitlabClient from gitlab2prov.models import create_graph from gitlab2prov.procs import (CommitProcessor, CommitResourceProcessor, IssueResourceProcessor, MergeRequestResourceProcessor, ReleaseTagProc...
from typing import List, Tuple from prov.model import ProvDocument from gitlab2prov.api import GitlabClient from gitlab2prov.models import create_graph from gitlab2prov.procs import (CommitProcessor, CommitResourceProcessor, IssueResourceProcessor, MergeRequestResourceProcessor, ReleaseTagProc...
en
0.916788
Pipeline that fetches, processes and models git commits of a project. Retrieve commits and their diffs from the project API wrapper. Return list of commit model packages. Return populated PROV graph for resource model. Pipeline that fetches, processes and models project commits. Retrieve commits and their notes from th...
2.46897
2
setup.py
taintedkernel/powerline-vcsh
0
6632075
<filename>setup.py from setuptools import setup setup( name = 'powerline-vcsh', description = 'A Powerline segment for showing the current VCSH repo', version = '1.0.0', keywords = 'powerline vcsh prompt', license = 'MIT', author = '<NAME>', author_email = '<EMA...
<filename>setup.py from setuptools import setup setup( name = 'powerline-vcsh', description = 'A Powerline segment for showing the current VCSH repo', version = '1.0.0', keywords = 'powerline vcsh prompt', license = 'MIT', author = '<NAME>', author_email = '<EMA...
none
1
1.303054
1
CryostatGUI/util/broker_app_clients.py
Cryostat-GUI/Cryostat-GUI
2
6632076
<filename>CryostatGUI/util/broker_app_clients.py #!/usr/bin/python # -*- coding: UTF-8 -*- # This broker subscribes to all applications. # If an application sends a signal, the Broker will publish the signal to all ControlClients subscribed to this broker. import zmq def main(): context = zmq.Context() ...
<filename>CryostatGUI/util/broker_app_clients.py #!/usr/bin/python # -*- coding: UTF-8 -*- # This broker subscribes to all applications. # If an application sends a signal, the Broker will publish the signal to all ControlClients subscribed to this broker. import zmq def main(): context = zmq.Context() ...
en
0.769738
#!/usr/bin/python # -*- coding: UTF-8 -*- # This broker subscribes to all applications. # If an application sends a signal, the Broker will publish the signal to all ControlClients subscribed to this broker. # Socket facing producers # Socket facing consumers # We never get here…
2.271631
2
ginga/qtw/plugins/WBrowser.py
astrofrog/ginga
1
6632077
<filename>ginga/qtw/plugins/WBrowser.py<gh_stars>1-10 # # WBrowser.py -- Web Browser plugin for fits viewer # # <NAME> (<EMAIL>) # # Copyright (c) <NAME>. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import sys, os from ginga impor...
<filename>ginga/qtw/plugins/WBrowser.py<gh_stars>1-10 # # WBrowser.py -- Web Browser plugin for fits viewer # # <NAME> (<EMAIL>) # # Copyright (c) <NAME>. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import sys, os from ginga impor...
en
0.746536
# # WBrowser.py -- Web Browser plugin for fits viewer # # <NAME> (<EMAIL>) # # Copyright (c) <NAME>. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # # superclass defines some variables for us, like logger #sw.set_border_width(2) #END
2.116008
2
interact/agents/__init__.py
rystrauss/interact
1
6632078
from .a2c import A2CAgent from .ddpg import DDPGAgent, TD3Agent from .dqn import DQNAgent from .ppg import PPGAgent from .ppo import PPOAgent from .sac import SACAgent
from .a2c import A2CAgent from .ddpg import DDPGAgent, TD3Agent from .dqn import DQNAgent from .ppg import PPGAgent from .ppo import PPOAgent from .sac import SACAgent
none
1
0.989007
1
SimModel_Python_API/simmodel_swig/Release/SimConnection_HotWaterFlow_Default.py
EnEff-BIM/EnEffBIM-Framework
3
6632079
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.7 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2, 6, 0): def swig_import_helper(): from os.path imp...
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.7 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2, 6, 0): def swig_import_helper(): from os.path imp...
en
0.890954
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.7 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. # Python < 2.2 doesn't have 'property'. # This file is compatible with both classic and new-style classes.
2.041446
2
02/02-1.py
pak21/aoc2017
0
6632080
#!/usr/bin/python3 import sys with open(sys.argv[1]) as input_file: total = 0 for line in input_file: number_strings = line.rstrip().split() numbers = [int(s) for s in number_strings] min_value = min(numbers) max_value = max(numbers) difference = max_value - min_value ...
#!/usr/bin/python3 import sys with open(sys.argv[1]) as input_file: total = 0 for line in input_file: number_strings = line.rstrip().split() numbers = [int(s) for s in number_strings] min_value = min(numbers) max_value = max(numbers) difference = max_value - min_value ...
fr
0.386793
#!/usr/bin/python3
3.539333
4
mergify_engine/constants.py
truthiswill/mergify-engine
266
6632081
<gh_stars>100-1000 # -*- encoding: utf-8 -*- # # Copyright © 2020 Mergify 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 re...
# -*- encoding: utf-8 -*- # # Copyright © 2020 Mergify 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 applicabl...
en
0.802157
# -*- encoding: utf-8 -*- # # Copyright © 2020 Mergify 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 applicabl...
1.354154
1
src/lib/nets/volumetric/unet3p3d.py
charzharr/Hierarchical-Contrastive-Pretraining
0
6632082
<reponame>charzharr/Hierarchical-Contrastive-Pretraining<filename>src/lib/nets/volumetric/unet3p3d.py import torch from torch import nn import torch.nn.functional as F from ..basemodel import BaseModel class _EncBlk_3d(nn.Module): def __init__(self, in_channels, out_channels, dropout=False): s...
import torch from torch import nn import torch.nn.functional as F from ..basemodel import BaseModel class _EncBlk_3d(nn.Module): def __init__(self, in_channels, out_channels, dropout=False): super(_EncBlk_3d, self).__init__() layers = [ nn.Conv3d(in_channels, out_channels, ...
en
0.520822
# class _DecBlk_3d(nn.Module): # def __init__(self, in_channels, middle_channels, out_channels): # super(_DecBlk_3d, self).__init__() # self.decode = nn.Sequential( # nn.Conv3d(in_channels, middle_channels, kernel_size=3, padding=1), # nn.BatchNorm3d(middle_channels), # ...
2.394014
2
cohere/src_py/utilities/transtest.py
brussel13/cohere
7
6632083
<filename>cohere/src_py/utilities/transtest.py import numpy as np dims=(5,5,5) dxdir=1 dydir=1 dzdir=1 r = np.mgrid[(dims[0] - 1) * dxdir:-dxdir:-dxdir, \ 0:dims[1] * dydir:dydir,\ 0:dims[2] * dzdir:dzdir] origshape=r.shape r.shape = 3, dims[0] * dims[1] * dims[2] r = r.transpose() Tdir=np.a...
<filename>cohere/src_py/utilities/transtest.py import numpy as np dims=(5,5,5) dxdir=1 dydir=1 dzdir=1 r = np.mgrid[(dims[0] - 1) * dxdir:-dxdir:-dxdir, \ 0:dims[1] * dydir:dydir,\ 0:dims[2] * dzdir:dzdir] origshape=r.shape r.shape = 3, dims[0] * dims[1] * dims[2] r = r.transpose() Tdir=np.a...
none
1
2.497994
2
amqtt/mqtt/protocol/client_handler.py
nfsnfs/amqtt
29
6632084
<gh_stars>10-100 # Copyright (c) 2015 <NAME> # # See the file license.txt for copying permission. import asyncio from asyncio import futures from amqtt.mqtt.protocol.handler import ProtocolHandler, EVENT_MQTT_PACKET_RECEIVED from amqtt.mqtt.disconnect import DisconnectPacket from amqtt.mqtt.pingreq import PingReqPacket...
# Copyright (c) 2015 <NAME> # # See the file license.txt for copying permission. import asyncio from asyncio import futures from amqtt.mqtt.protocol.handler import ProtocolHandler, EVENT_MQTT_PACKET_RECEIVED from amqtt.mqtt.disconnect import DisconnectPacket from amqtt.mqtt.pingreq import PingReqPacket from amqtt.mqtt....
en
0.742393
# Copyright (c) 2015 <NAME> # # See the file license.txt for copying permission. :param topics: array of topics [{'filter':'/a/b', 'qos': 0x00}, ...] :return: # Build and send SUBSCRIBE message # Wait for SUBACK is received :param topics: array of topics ['/a/b', ...] :return:
1.919793
2
tripleoclient/tests/v1/test_overcloud_export.py
d34dh0r53/python-tripleoclient
0
6632085
<reponame>d34dh0r53/python-tripleoclient # Copyright 2019 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
# Copyright 2019 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
en
0.851995
# Copyright 2019 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
1.775921
2
tests/test_3_nii_dicomseg_conversion.py
deepc-health/nekton
0
6632086
<reponame>deepc-health/nekton import pytest import os import glob import nibabel as nib import pydicom from pydicom.dataset import Dataset from pydicom_seg.segmentation_dataset import SegmentationDataset from nekton.utils.json_helpers import write_json @pytest.mark.nii2dcmseg def test_3_1_check_loading_segmapping(con...
import pytest import os import glob import nibabel as nib import pydicom from pydicom.dataset import Dataset from pydicom_seg.segmentation_dataset import SegmentationDataset from nekton.utils.json_helpers import write_json @pytest.mark.nii2dcmseg def test_3_1_check_loading_segmapping(converter_dcmseg): converter ...
en
0.681791
# load the correct mapping # no valid seg path # nonstd json # when the number of dicoms is a mismatch # removing the first dicom path from the list
2.140682
2
dvc/utils/http.py
Abrosimov-a-a/dvc
0
6632087
import io from contextlib import contextmanager from dvc.utils.compat import FileNotFoundError @contextmanager def open_url(url, mode="r", encoding=None): """Opens an url as a readable stream. Resumes on connection error. Url could be a string or a callable returning a string. """ assert mode in...
import io from contextlib import contextmanager from dvc.utils.compat import FileNotFoundError @contextmanager def open_url(url, mode="r", encoding=None): """Opens an url as a readable stream. Resumes on connection error. Url could be a string or a callable returning a string. """ assert mode in...
en
0.900914
Opens an url as a readable stream. Resumes on connection error. Url could be a string or a callable returning a string. Iterate over chunks requested from url. # Reopen request from where we stopped # Ensure connection is closed Wraps an iterator yielding bytes as a file object # Python 3 requires only .readin...
2.962671
3
test/helper/output/message_test.py
jakob-bagterp/timer-for-python
2
6632088
from _helper.random import random_decimals, random_thread_name from _helper.time_fractions import (random_days_as_ns, random_hours_as_ns, random_microseconds_as_ns, random_milliseconds_as_ns, random_minutes_as_ns...
from _helper.random import random_decimals, random_thread_name from _helper.time_fractions import (random_days_as_ns, random_hours_as_ns, random_microseconds_as_ns, random_milliseconds_as_ns, random_minutes_as_ns...
none
1
2.345821
2
dit/multivariate/common_informations/base_markov_optimizer.py
leoalfonso/dit
1
6632089
<filename>dit/multivariate/common_informations/base_markov_optimizer.py """ Abstract base classes """ from __future__ import division from abc import abstractmethod import numpy as np from ...algorithms import BaseAuxVarOptimizer from ...utils import unitful from ..dual_total_correlation import dual_total_correlati...
<filename>dit/multivariate/common_informations/base_markov_optimizer.py """ Abstract base classes """ from __future__ import division from abc import abstractmethod import numpy as np from ...algorithms import BaseAuxVarOptimizer from ...utils import unitful from ..dual_total_correlation import dual_total_correlati...
en
0.770997
Abstract base classes Abstract base class for constructing auxiliary variables which render a set of variables conditionally independent. Initialize the optimizer. Parameters ---------- dist : Distribution The distribution to compute the auxiliary Markov variable, W, for. ...
2.559445
3
sashimmi/subcommands/bind.py
chpatton013/sashimmi
0
6632090
<filename>sashimmi/subcommands/bind.py from .subcommand import SubcommandBaseWithWorkspaceWriteLock, register_subcommand from ..models.shim import read_shims_node, bind_shims class BindSubcommand(SubcommandBaseWithWorkspaceWriteLock): def name(self): return "bind" def help(self): return "Bind...
<filename>sashimmi/subcommands/bind.py from .subcommand import SubcommandBaseWithWorkspaceWriteLock, register_subcommand from ..models.shim import read_shims_node, bind_shims class BindSubcommand(SubcommandBaseWithWorkspaceWriteLock): def name(self): return "bind" def help(self): return "Bind...
none
1
2.310998
2
ucbgradedists/ucbgradedists/settings/base.py
dailycal-projects/grades
5
6632091
import os import dj_database_url from django.core.exceptions import ImproperlyConfigured from unipath import Path # Number of digits to use in rounding mean and standard deviation PRECISION = 3 def env_var(var_name): """Get the environment variable VAR_NAME, or raise an Exception.""" try: return os.en...
import os import dj_database_url from django.core.exceptions import ImproperlyConfigured from unipath import Path # Number of digits to use in rounding mean and standard deviation PRECISION = 3 def env_var(var_name): """Get the environment variable VAR_NAME, or raise an Exception.""" try: return os.en...
en
0.612886
# Number of digits to use in rounding mean and standard deviation Get the environment variable VAR_NAME, or raise an Exception. # Basic settings # Email settings, assuming you use gmail. # Set up directory structure and static files # Application definition # Database # https://docs.djangoproject.com/en/1.8/ref/setting...
2.176843
2
py101/static_meth_att.py
fernandozamoraj/py_sandbox
0
6632092
class Student: _staticval = -1 @classmethod def myclassmethod(x): print(x._staticval) @staticmethod def mystaticmethod(): print(Student._staticval) def my_method(self): print(Student._staticval) Studen...
class Student: _staticval = -1 @classmethod def myclassmethod(x): print(x._staticval) @staticmethod def mystaticmethod(): print(Student._staticval) def my_method(self): print(Student._staticval) Studen...
none
1
3.060092
3
infoqscraper/test/test_convert.py
naxhh/infoqscraper
41
6632093
# -*- coding: utf-8 -*- # # Copyright (c) 2012, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of...
# -*- coding: utf-8 -*- # # Copyright (c) 2012, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of...
en
0.689788
# -*- coding: utf-8 -*- # # Copyright (c) 2012, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of...
1.662337
2
waller/waller.py
codeswhite/waller
0
6632094
import curses import os import stat import random import sys from pathlib import PosixPath from subprocess import check_output, check_call, call, CalledProcessError from typing import List, Iterator, Tuple from .ldm_gtk import LdmGtk def get_cmd(monitor_name: str) -> List[str]: """ The system command which ...
import curses import os import stat import random import sys from pathlib import PosixPath from subprocess import check_output, check_call, call, CalledProcessError from typing import List, Iterator, Tuple from .ldm_gtk import LdmGtk def get_cmd(monitor_name: str) -> List[str]: """ The system command which ...
en
0.722596
The system command which will return path of monitor's wallpaper * Depends on 'xfconf' Checks the file signature (magic number) for an image :param image_path: The path to the image :return: True if the image is PNG or JPG Collect connected monitors, via xRandr :return: Monitor names # Chec...
2.335074
2
api/djangorestapp/admin.py
hca-foundation/urbangreenlab
1
6632095
from . import models from django.contrib.admin import AdminSite from django.template.response import TemplateResponse from django.http import HttpResponse from django.urls import path class MyAdminSite(AdminSite): def get_urls(self): urls = super().get_urls() urls += [ path('my_view/'...
from . import models from django.contrib.admin import AdminSite from django.template.response import TemplateResponse from django.http import HttpResponse from django.urls import path class MyAdminSite(AdminSite): def get_urls(self): urls = super().get_urls() urls += [ path('my_view/'...
en
0.968259
# Register your models here.
2.205112
2
diplomacy/tests/mila_actions_test.py
maayanorner/diplomacy
0
6632096
# Copyright 2021 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
# Copyright 2021 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
en
0.870705
# Copyright 2021 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
2.320423
2
jupyter_kernel_test/__init__.py
tgb417/jupyter_kernel_test
0
6632097
"""Machinery for testing Jupyter kernels via the messaging protocol. """ from unittest import TestCase, SkipTest from queue import Empty from jupyter_client.manager import start_new_kernel from .messagespec import validate_message, MimeBundle TIMEOUT = 15 __version__ = '0.3' class KernelTests(TestCase): kernel...
"""Machinery for testing Jupyter kernels via the messaging protocol. """ from unittest import TestCase, SkipTest from queue import Empty from jupyter_client.manager import start_new_kernel from .messagespec import validate_message, MimeBundle TIMEOUT = 15 __version__ = '0.3' class KernelTests(TestCase): kernel...
en
0.56834
Machinery for testing Jupyter kernels via the messaging protocol. # Validate the mimebundle # this should match one of the values in code_execute_result
2.377688
2
utils/swift_build_support/tests/test_targets.py
EBGToo/swift
0
6632098
# test_targets.py - Unit tests for swift_build_support.targets -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt...
# test_targets.py - Unit tests for swift_build_support.targets -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt...
en
0.773155
# test_targets.py - Unit tests for swift_build_support.targets -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt...
2.507907
3
setup.py
kgermain/Qt.py
800
6632099
<filename>setup.py import os from setuptools import setup os.environ["QT_PREFERRED_BINDING"] = "None" version = __import__("Qt").__version__ classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python",...
<filename>setup.py import os from setuptools import setup os.environ["QT_PREFERRED_BINDING"] = "None" version = __import__("Qt").__version__ classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python",...
none
1
1.258557
1
benchmarks/imports.py
skshetry/dvc-bench
20
6632100
<filename>benchmarks/imports.py from benchmarks.base import BaseBench, BaseRemoteBench class ImportBench(BaseBench): repeat = 1 timeout = 12000 def setup(self): super().setup() self.init_git() self.init_dvc() def time_imports(self): repo = f"file://{self.project_dir}...
<filename>benchmarks/imports.py from benchmarks.base import BaseBench, BaseRemoteBench class ImportBench(BaseBench): repeat = 1 timeout = 12000 def setup(self): super().setup() self.init_git() self.init_dvc() def time_imports(self): repo = f"file://{self.project_dir}...
none
1
2.363415
2
tool/pylib/misc/ExtMap.py
mever/qooxdoo
1
6632101
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2006-2010 1&1 Internet AG, Germany, http://www.1und1.de # # License: # MIT: https:/...
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2006-2010 1&1 Internet AG, Germany, http://www.1und1.de # # License: # MIT: https://opensource.org...
en
0.566828
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2006-2010 1&1 Internet AG, Germany, http://www.1und1.de # # License: # MIT: https://opensource.org...
2.320555
2
horovod/unet_training_horovod-60.py
explcre/SHUKUN-Technology-Co.-Ltd-Algorithm-intern
1
6632102
<gh_stars>1-10 # Copyright 2020 MONAI Consortium # 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 t...
# Copyright 2020 MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, s...
en
0.748371
# Copyright 2020 MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, s...
1.888156
2
oscar/lib/python2.7/site-packages/PIL/XpmImagePlugin.py
sainjusajan/django-oscar
0
6632103
# # The Python Imaging Library. # $Id$ # # XPM File handling # # History: # 1996-12-29 fl Created # 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.7) # # Copyright (c) Secret Labs AB 1997-2001. # Copyright (c) <NAME> 1996-2001. # # See the README file for information on usage and redistribut...
# # The Python Imaging Library. # $Id$ # # XPM File handling # # History: # 1996-12-29 fl Created # 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.7) # # Copyright (c) Secret Labs AB 1997-2001. # Copyright (c) <NAME> 1996-2001. # # See the README file for information on usage and redistribut...
en
0.583133
# # The Python Imaging Library. # $Id$ # # XPM File handling # # History: # 1996-12-29 fl Created # 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.7) # # Copyright (c) Secret Labs AB 1997-2001. # Copyright (c) <NAME> 1996-2001. # # See the README file for information on usage and redistribution. # # XPM ...
2.53224
3
main_app/migrations/0014_auto_20211114_2331.py
barkev2009/eurovision-app
1
6632104
# Generated by Django 2.2.12 on 2021-11-14 20:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main_app', '0013_auto_20211114_2326'), ] operations = [ migrations.RemoveField( model_name='entry', name='score', ...
# Generated by Django 2.2.12 on 2021-11-14 20:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main_app', '0013_auto_20211114_2326'), ] operations = [ migrations.RemoveField( model_name='entry', name='score', ...
en
0.774066
# Generated by Django 2.2.12 on 2021-11-14 20:31
1.75183
2
chainer/training/triggers/minmax_value_trigger.py
Evanc123/chainer
0
6632105
from chainer import reporter from chainer.training import util class BestValueTrigger(object): """Trigger invoked when specific value becomes best. Args: key (str): Key of value. compare (callable): Compare function which takes current best value and new value and returns whether...
from chainer import reporter from chainer.training import util class BestValueTrigger(object): """Trigger invoked when specific value becomes best. Args: key (str): Key of value. compare (callable): Compare function which takes current best value and new value and returns whether...
en
0.806624
Trigger invoked when specific value becomes best. Args: key (str): Key of value. compare (callable): Compare function which takes current best value and new value and returns whether new value is better than current best. trigger: Trigger that decides the comparison ...
2.847794
3
bin/hist.py
CoderVikas/mindotfiles
0
6632106
#!/usr/bin/env python # x.startswith("_") f = open('/Users/yadvika/.bash_history') l = f.readlines() l.reverse() short = [] cmdline_included = 0 for s in l: if s.startswith("#"): if cmdline_included == 1: short.append(s.rstrip()) continue # marked not-include unless we really add it to short cmdline_inc...
#!/usr/bin/env python # x.startswith("_") f = open('/Users/yadvika/.bash_history') l = f.readlines() l.reverse() short = [] cmdline_included = 0 for s in l: if s.startswith("#"): if cmdline_included == 1: short.append(s.rstrip()) continue # marked not-include unless we really add it to short cmdline_inc...
en
0.749135
#!/usr/bin/env python # x.startswith("_") # marked not-include unless we really add it to short
2.706033
3
tcevent.py
metocean/tcrm
0
6632107
<filename>tcevent.py """ :mod:`tcevent` -- run the windfield module for a single TC track ================================================================ .. module:: tcevent :synopsis: Run the wind field module for a single TC track. Run the :mod:`wind.windmodels` module to calculate the wind field for a single ...
<filename>tcevent.py """ :mod:`tcevent` -- run the windfield module for a single TC track ================================================================ .. module:: tcevent :synopsis: Run the wind field module for a single TC track. Run the :mod:`wind.windmodels` module to calculate the wind field for a single ...
en
0.708444
:mod:`tcevent` -- run the windfield module for a single TC track ================================================================ .. module:: tcevent :synopsis: Run the wind field module for a single TC track. Run the :mod:`wind.windmodels` module to calculate the wind field for a single TC event. The track of th...
2.581006
3
example/python/tx-example.py
laSinteZ/iroha
1
6632108
from __future__ import print_function import sys # import iroha library from nested folder sys.path.insert(0, 'build/shared_model/bindings') import iroha import time import block_pb2 import endpoint_pb2 import endpoint_pb2_grpc import queries_pb2 import grpc tx_builder = iroha.ModelTransactionBuilder() query_builder...
from __future__ import print_function import sys # import iroha library from nested folder sys.path.insert(0, 'build/shared_model/bindings') import iroha import time import block_pb2 import endpoint_pb2 import endpoint_pb2_grpc import queries_pb2 import grpc tx_builder = iroha.ModelTransactionBuilder() query_builder...
en
0.603712
# import iroha library from nested folder # build transaction # create proto object and send to iroha # create status request #ru") \
2.054396
2
os_migrate/plugins/module_utils/workload_common.py
rbrady/os-migrate
0
6632109
<gh_stars>0 from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import logging import os import subprocess import time # Default timeout for OpenStack operations DEFAULT_TIMEOUT = 600 # Lock to serialize volume attachments. This helps prevent device path # mismatches b...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import logging import os import subprocess import time # Default timeout for OpenStack operations DEFAULT_TIMEOUT = 600 # Lock to serialize volume attachments. This helps prevent device path # mismatches between the O...
en
0.851649
# Default timeout for OpenStack operations # Lock to serialize volume attachments. This helps prevent device path # mismatches between the OpenStack SDK and /dev in the VM. # File containing ports used by all the nbdkit processes running on the source # conversion host. There is a check to see if the port is available,...
2.169196
2
python/CRUD-examples/delete/foreign_keys.py
alanfeng99/oracle-db-examples
1,071
6632110
# Code Sample from the tutorial at https://learncodeshare.net/2015/07/09/delete-crud-using-cx_oracle/ # section titled "Deleting records referenced by Foreign Keys" 1st example # Using the base template, the example code executes a simple delete using named bind variables. # When following the tutorial with defaul...
# Code Sample from the tutorial at https://learncodeshare.net/2015/07/09/delete-crud-using-cx_oracle/ # section titled "Deleting records referenced by Foreign Keys" 1st example # Using the base template, the example code executes a simple delete using named bind variables. # When following the tutorial with defaul...
en
0.768067
# Code Sample from the tutorial at https://learncodeshare.net/2015/07/09/delete-crud-using-cx_oracle/ # section titled "Deleting records referenced by Foreign Keys" 1st example # Using the base template, the example code executes a simple delete using named bind variables. # When following the tutorial with default d...
3.461673
3
GUI_projects/alarm clock.py
renataeva/python-basics
1
6632111
from tkinter import * import random window = Tk() window.geometry('250x350') window.title('Будильник') window.iconbitmap('alarm.ico') def deletef(): indexes = alarmbox.curselection() for i in reversed(indexes): alarmbox.delete(i) status.config(text=f'Всего будильников: {alarmbox.size()}') def o...
from tkinter import * import random window = Tk() window.geometry('250x350') window.title('Будильник') window.iconbitmap('alarm.ico') def deletef(): indexes = alarmbox.curselection() for i in reversed(indexes): alarmbox.delete(i) status.config(text=f'Всего будильников: {alarmbox.size()}') def o...
none
1
3.374881
3
src/sensors/sensor_benchmark.py
adeo/benchmark-tipboard
0
6632112
import time from src.sensors.matomo_utils import valueFromAction, getDevices from src.sensors.utils import end, sendDataToTipboard from src.tipboard.app.properties import COLOR_TAB def updateNormChartTipBoard(bench, tile, isTest=False): if not "values" in bench[0]: return datasetLength = len(bench) ...
import time from src.sensors.matomo_utils import valueFromAction, getDevices from src.sensors.utils import end, sendDataToTipboard from src.tipboard.app.properties import COLOR_TAB def updateNormChartTipBoard(bench, tile, isTest=False): if not "values" in bench[0]: return datasetLength = len(bench) ...
none
1
2.296878
2
python/paddle/fluid/tests/unittests/test_parallel_executor_fix_op_run_order.py
xingjing1/Paddle
0
6632113
# Copyright (c) 2021 PaddlePaddle 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 ap...
# Copyright (c) 2021 PaddlePaddle 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 ap...
en
0.856067
# Copyright (c) 2021 PaddlePaddle 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 appli...
1.998102
2
migrations/versions/672fc4e15fc5_.py
mytopdog/fndash
0
6632114
"""empty message Revision ID: 672fc4e15fc5 Revises: <PASSWORD> Create Date: 2019-03-09 06:41:05.722187 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '672fc4e15fc5' down_revision = '<PASSWORD>' branch_labels = None depends_on = None def upgrade(): # ### ...
"""empty message Revision ID: 672fc4e15fc5 Revises: <PASSWORD> Create Date: 2019-03-09 06:41:05.722187 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '672fc4e15fc5' down_revision = '<PASSWORD>' branch_labels = None depends_on = None def upgrade(): # ### ...
en
0.427171
empty message Revision ID: 672fc4e15fc5 Revises: <PASSWORD> Create Date: 2019-03-09 06:41:05.722187 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic comma...
1.414971
1
clld/web/datatables/unitvalue.py
Woseseltops/clld
1
6632115
<filename>clld/web/datatables/unitvalue.py from sqlalchemy.orm import joinedload from clld.db.models import common from clld.web.datatables.base import DataTable, LinkCol class UnitValueNameCol(LinkCol): def order(self): return common.UnitDomainElement.id \ if self.dt.unitparameter and self.d...
<filename>clld/web/datatables/unitvalue.py from sqlalchemy.orm import joinedload from clld.db.models import common from clld.web.datatables.base import DataTable, LinkCol class UnitValueNameCol(LinkCol): def order(self): return common.UnitDomainElement.id \ if self.dt.unitparameter and self.d...
zh
0.077338
#query = query.join(common.UnitParameter, common.Contribution) #query = query.join(common.Contribution, common.Unit) #query = query.join(common.Unit, common.UnitParameter)
2.137566
2
scrape.py
Brok-Bucholtz/Grad-Job-Classification
0
6632116
<gh_stars>0 import csv from os import path, makedirs import ipgetter import requests from dateutil import parser from pymongo import DESCENDING from feature_extraction import degree_classification def _update_array_fields(model, current_values, new_field_values): """ Update all array fields if they don't co...
import csv from os import path, makedirs import ipgetter import requests from dateutil import parser from pymongo import DESCENDING from feature_extraction import degree_classification def _update_array_fields(model, current_values, new_field_values): """ Update all array fields if they don't contain the ne...
en
0.712809
Update all array fields if they don't contain the new values :param model: DB Base Model :param current_values: Dictionary of current values for model :param new_field_values: Dictionary of new values that should be in arrays :return: Finish processing scraped jobs :param database: Database to updat...
3.00033
3
google/cloud/datastore_v1/types/datastore.py
Vincent-Weng/python-datastore
0
6632117
<reponame>Vincent-Weng/python-datastore # -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
en
0.790217
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
1.710338
2
initialisers/database.py
PeriGK/MIL
0
6632118
<reponame>PeriGK/MIL import logging def initialise_database_connection(database_conf): logging.info('Initialising database')
import logging def initialise_database_connection(database_conf): logging.info('Initialising database')
none
1
1.646313
2
tests/dag/test_dagclients.py
MarcoJHB/ploomber
2,141
6632119
from pathlib import Path from unittest.mock import Mock import pytest from ploomber.dag.dagclients import DAGClients from ploomber.tasks import SQLScript from ploomber.products import File from ploomber.util.dotted_path import DottedPath from ploomber.clients import LocalStorageClient def test_error_if_setting_inva...
from pathlib import Path from unittest.mock import Mock import pytest from ploomber.dag.dagclients import DAGClients from ploomber.tasks import SQLScript from ploomber.products import File from ploomber.util.dotted_path import DottedPath from ploomber.clients import LocalStorageClient def test_error_if_setting_inva...
en
0.627441
from ploomber.clients import LocalStorageClient def get_client(): return LocalStorageClient('backup', path_to_project_root='.') # this happens when using the spec API and lazy load is turned on
2.450317
2
Jobindex_webscrape.py
Yousef0353/Data-Science-Projects
0
6632120
# -*- coding: utf-8 -*- """ Created on Fri Mar 25 18:54:45 2022 @author: balas """ import requests from bs4 import BeautifulSoup import pandas as pd def extract(location,tag, page): #Using User Agent,sometimes you will find that the webserver blocks certain user agents. #This is mostly because ...
# -*- coding: utf-8 -*- """ Created on Fri Mar 25 18:54:45 2022 @author: balas """ import requests from bs4 import BeautifulSoup import pandas as pd def extract(location,tag, page): #Using User Agent,sometimes you will find that the webserver blocks certain user agents. #This is mostly because ...
en
0.730492
# -*- coding: utf-8 -*- Created on Fri Mar 25 18:54:45 2022 @author: balas #Using User Agent,sometimes you will find that the webserver blocks certain user agents. #This is mostly because it identifies the origin as a bot and certain websites don't allow bot crawlers or scrapers. #Manipulating the jobindex URL #This...
3.132297
3
src/grokcore/component/tests/event/provideHandler.py
zopefoundation/grokcore.component
1
6632121
<filename>src/grokcore/component/tests/event/provideHandler.py<gh_stars>1-10 """ When you use the @grokcore.component.subscribe decorator, you can also use zope.component.provideHandler to register the subscriber. This can be useful for unittests where you may not want to grok everything in a module but just enable ce...
<filename>src/grokcore/component/tests/event/provideHandler.py<gh_stars>1-10 """ When you use the @grokcore.component.subscribe decorator, you can also use zope.component.provideHandler to register the subscriber. This can be useful for unittests where you may not want to grok everything in a module but just enable ce...
en
0.591073
When you use the @grokcore.component.subscribe decorator, you can also use zope.component.provideHandler to register the subscriber. This can be useful for unittests where you may not want to grok everything in a module but just enable certain components. >>> from zope.interface.interfaces import ObjectEvent >>> ...
2.071826
2
propagators/math_utils.py
mikelytaev/wave-propagation
15
6632122
class DeltaFunction: def __init__(self, x_c): self.x_c = x_c
class DeltaFunction: def __init__(self, x_c): self.x_c = x_c
none
1
1.975258
2
scripts_gym/script2.py
lbaiao/sys-simulator-2
1
6632123
<gh_stars>1-10 from shutil import copyfile import numpy as np from torch.utils.tensorboard.writer import SummaryWriter from sys_simulator.general.ou_noise import OUNoise from sys_simulator.ddpg.agent import Agent import torch from sys_simulator.ddpg.framework import Framework import gym from time import time import sys...
from shutil import copyfile import numpy as np from torch.utils.tensorboard.writer import SummaryWriter from sys_simulator.general.ou_noise import OUNoise from sys_simulator.ddpg.agent import Agent import torch from sys_simulator.ddpg.framework import Framework import gym from time import time import sys_simulator.gene...
en
0.541212
# MAX_NUM_EPISODES = 12000 # STEPS_PER_EPISODE = 500 # REPLAY_INITIAL = 10000 # env = NormalizedActions(gym.make('Pendulum-v0')) # if REPLAY_MEMORY_TYPE == 'prioritized': # framework.replay_memory.correct_beta(i, STEPS_PER_EPISODE) # last test # save stuff # rewards.append(np.mean(ep_rewards)) # save stuff
1.977996
2
mycroft/tts/mary_tts.py
NeonDaniel/HolmesV
9
6632124
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
en
0.84995
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
2.222969
2
app.py
pprats/um-tdd
0
6632125
<gh_stars>0 from main import create_app from main import db from main.models import UserModel import os def create_admins_in_db(): admins = db.session.query(UserModel.id_num).filter(UserModel.admin == True) admins_list = [admin for admin, in admins] if len(admins_list) == 0: print("Creando admin"...
from main import create_app from main import db from main.models import UserModel import os def create_admins_in_db(): admins = db.session.query(UserModel.id_num).filter(UserModel.admin == True) admins_list = [admin for admin, in admins] if len(admins_list) == 0: print("Creando admin") us...
en
0.885759
# Creating Flask app instance # Loading app context # If this script is run, the db is created if not; and the app is run in an specific port
2.757615
3
insights/core/filters.py
mglantz/insights-core
1
6632126
""" The filters module allows developers to apply filters to datasources. A filter is a simple string, and it matches if it is contained anywhere within a line. If a datasource has filters defined, it will return only lines matching at least one of them. If a datasource has no filters, it will return all lines. Filte...
""" The filters module allows developers to apply filters to datasources. A filter is a simple string, and it matches if it is contained anywhere within a line. If a datasource has filters defined, it will return only lines matching at least one of them. If a datasource has no filters, it will return all lines. Filte...
en
0.83591
The filters module allows developers to apply filters to datasources. A filter is a simple string, and it matches if it is contained anywhere within a line. If a datasource has filters defined, it will return only lines matching at least one of them. If a datasource has no filters, it will return all lines. Filters a...
2.08842
2
lib/utils/logger.py
wjbKimberly/DetectAndTrack-wjb
1,007
6632127
############################################################## # Copyright (c) 2018-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. ############################################################## fro...
############################################################## # Copyright (c) 2018-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. ############################################################## fro...
en
0.443647
############################################################## # Copyright (c) 2018-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. ############################################################## # Pr...
2.313379
2
openstackclient/tests/functional/compute/v2/test_aggregate.py
BeyondTheClouds/python-openstackclient
0
6632128
<reponame>BeyondTheClouds/python-openstackclient # 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 applic...
# 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 # d...
en
0.867302
# 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 # d...
2.368147
2
PMS5003.py
andyrew/pi-airq
0
6632129
<reponame>andyrew/pi-airq<filename>PMS5003.py import serial import struct import sys import bisect aqi_breakpoints = [ 0, 50, 100, 150, 200, 300, 400, 500 ] aqi_pm25_breakpoints = [ 0, 12.1, 35.5, 55.5, 150.5, 250.5, 350.5, 500.5 ] class PMS5003: def __init__(self, serial_terminal="/dev/serial...
import serial import struct import sys import bisect aqi_breakpoints = [ 0, 50, 100, 150, 200, 300, 400, 500 ] aqi_pm25_breakpoints = [ 0, 12.1, 35.5, 55.5, 150.5, 250.5, 350.5, 500.5 ] class PMS5003: def __init__(self, serial_terminal="/dev/serial0"): self.serial_terminal = serial_term...
en
0.831536
# The following block of code is largely taken from Adafruit Learning System Guides # # github.com/adafruit/Adafruit_Learning_System_Guides/PMS5003_Air_Quality_Sensor/PMS5003_CircuitPython/main.py # Copyright (c) 2018 Adafruit Industries # # Permission is hereby granted, free of charge, to any person obtaining a copy #...
2.619102
3
src/tests/test_pagure_flask_ui_login.py
yifengyou/learn-pagure
0
6632130
# -*- coding: utf-8 -*- """ (c) 2016 - Copyright Red Hat Inc Authors: <NAME> <<EMAIL>> <NAME> <<EMAIL>> """ from __future__ import unicode_literals, absolute_import import datetime import hashlib import json import unittest import shutil import sys import tempfile import os import flask import pygit2 impo...
# -*- coding: utf-8 -*- """ (c) 2016 - Copyright Red Hat Inc Authors: <NAME> <<EMAIL>> <NAME> <<EMAIL>> """ from __future__ import unicode_literals, absolute_import import datetime import hashlib import json import unittest import shutil import sys import tempfile import os import flask import pygit2 impo...
en
0.852417
# -*- coding: utf-8 -*- (c) 2016 - Copyright Red Hat Inc Authors: <NAME> <<EMAIL>> <NAME> <<EMAIL>> Tests for flask app controller of pagure Create the application with PAGURE_AUTH being local. # Remove the log handlers for the tests Test the front page. # First access the front page Test the new_user endpoint....
2.286891
2
narnia.py
maisammusthafa/narnia
0
6632131
#!/usr/bin/env python3 """ narnia """ import curses import curses.textpad import os import sys import time from narnia.colorstr import add_cstr, init_colors from narnia.common import Config as c, Globals as g, refresh_windows from narnia.common import Header, Status from narnia.download import Download from narnia.pr...
#!/usr/bin/env python3 """ narnia """ import curses import curses.textpad import os import sys import time from narnia.colorstr import add_cstr, init_colors from narnia.common import Config as c, Globals as g, refresh_windows from narnia.common import Header, Status from narnia.download import Download from narnia.pr...
en
0.628843
#!/usr/bin/env python3 narnia get downloads and create classes lookup downloads actions based on key input # TODO: [BUG] Does not ALWAYS properly pan up # TODO: Optimize here # TODO: Optimize here # TODO: TEST # c.keys.select: select, # c.keys.expand: expand, main # TODO: [BUG] initial delay even on fast networks
2.527144
3
api/urls.py
vimeworks/ImpaQto
0
6632132
from django.conf.urls import include, url from . import views urlpatterns = [ #url(r'^',include('coworkersimpaqto.urls')), url(r'^hola_mundo_rest/(?P<username>\w+)/$',views.hola_mundo), url(r'^coworker/$',views.coworker), url(r'^coworker/(?P<username>\w+)/$',views.coworker), url(r'^contrato/$',view...
from django.conf.urls import include, url from . import views urlpatterns = [ #url(r'^',include('coworkersimpaqto.urls')), url(r'^hola_mundo_rest/(?P<username>\w+)/$',views.hola_mundo), url(r'^coworker/$',views.coworker), url(r'^coworker/(?P<username>\w+)/$',views.coworker), url(r'^contrato/$',view...
en
0.591773
#url(r'^',include('coworkersimpaqto.urls')),
1.804785
2
test/test_file_header_parser.py
fkie-cad/Codescanner
5
6632133
<filename>test/test_file_header_parser.py import numpy import os import pytest import tempfile import unittest from file_header_parser import FileHeaderParser class FileHeaderParserTest(unittest.TestCase): def setUp(self): self._test_file_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '...
<filename>test/test_file_header_parser.py import numpy import os import pytest import tempfile import unittest from file_header_parser import FileHeaderParser class FileHeaderParserTest(unittest.TestCase): def setUp(self): self._test_file_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '...
none
1
2.514147
3
tools/train_al.py
PrateekMunjal/TorchAL
0
6632134
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # Modified by <NAME> from official pycls codebase inorder to add the AL functionality # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Train a classification model...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # Modified by <NAME> from official pycls codebase inorder to add the AL functionality # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Train a classification model...
en
0.77079
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # Modified by <NAME> from official pycls codebase inorder to add the AL functionality # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. Train a classification model. Basi...
1.901579
2
homematicip_tracking/__init__.py
Emrys-Merlin/homematicip_tracking
1
6632135
<filename>homematicip_tracking/__init__.py """Top-level package for HomematicIP Tracking.""" __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.0'
<filename>homematicip_tracking/__init__.py """Top-level package for HomematicIP Tracking.""" __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.0'
en
0.763209
Top-level package for HomematicIP Tracking. <NAME>
1.081332
1
digits/task.py
Benedict93/DIGITS
4,552
6632136
# Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import logging import os.path import platform import re import signal import subprocess import time import flask import gevent.event from . import utils from .config import config_value from .status import Sta...
# Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import logging import os.path import platform import re import signal import subprocess import time import flask import gevent.event from . import utils from .config import config_value from .status import Sta...
en
0.757931
# Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. # NOTE: Increment this every time the pickled version changes Base class for Tasks A Task is a compute-heavy operation that runs in a separate executable Communication is done by processing the stdout of the executable # Subprocess object for ...
2.046512
2
tests/test_memoization.py
toheedN/MemoizationTest
0
6632137
<gh_stars>0 import os import sys import time from time import sleep import pytest # Setup project paths sys.path.append(os.getcwd()) sys.path.append("../") # local imports from memoization import memoizer from memoization.memoizer import get_cache_stats @pytest.fixture(autouse=True) def reset_stats(): """ ...
import os import sys import time from time import sleep import pytest # Setup project paths sys.path.append(os.getcwd()) sys.path.append("../") # local imports from memoization import memoizer from memoization.memoizer import get_cache_stats @pytest.fixture(autouse=True) def reset_stats(): """ reset cache ...
en
0.780333
# Setup project paths # local imports reset cache access stats for each case :return: ################ Pre-Test Conditions #####################") ################## Resetting Stats #######################") Basic test for momoization with timeout, we shall check both with and without timeout of the cache key :para...
2.286992
2
predict_churn.py
kodama3d/msds_600_week5
0
6632138
import pandas as pd import numpy as np from pycaret.classification import predict_model, load_model def load_data(filepath): """ Loads churn data into a DataFrame from a string filepath. """ df = pd.read_csv(filepath, index_col='customerID') return df def make_predictions(df): """ Uses th...
import pandas as pd import numpy as np from pycaret.classification import predict_model, load_model def load_data(filepath): """ Loads churn data into a DataFrame from a string filepath. """ df = pd.read_csv(filepath, index_col='customerID') return df def make_predictions(df): """ Uses th...
en
0.825329
Loads churn data into a DataFrame from a string filepath. Uses the pycaret best model to make predictions on data in the df dataframe. # searching for the best model which changes based on modeling Runs full script if main is loaded Transforms new data to create matching features to the model
3.452793
3
specs/PointOfInterest/WeatherStation/harvesters/portugal/portugal_weather_stations.py
fsismondi/data-models
39
6632139
<reponame>fsismondi/data-models<gh_stars>10-100 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This program collects information about Portugal weather stations from IPMA and prepares config that can be used by harvester itself to upload the list of Portugal weather stations to Orion Context Broker or expo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This program collects information about Portugal weather stations from IPMA and prepares config that can be used by harvester itself to upload the list of Portugal weather stations to Orion Context Broker or export data required by other weather harvesters...
en
0.756923
#!/usr/bin/env python3 # -*- coding: utf-8 -*- This program collects information about Portugal weather stations from IPMA and prepares config that can be used by harvester itself to upload the list of Portugal weather stations to Orion Context Broker or export data required by other weather harvesters: -...
2.389421
2
bobtemplates/ielectric/pyramid/+package.dottedname+/site/models.py
djowett/bobtemplates.ielectric
0
6632140
import transaction #from sqlalchemy import Column #from sqlalchemy import Integer #from sqlalchemy import Unicode from sqlalchemy.exc import IntegrityError from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import scoped_session from sqlalchemy.orm import sessionmaker from zope.sqlalchemy i...
import transaction #from sqlalchemy import Column #from sqlalchemy import Integer #from sqlalchemy import Unicode from sqlalchemy.exc import IntegrityError from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import scoped_session from sqlalchemy.orm import sessionmaker from zope.sqlalchemy i...
es
0.088944
#from sqlalchemy import Column #from sqlalchemy import Integer #from sqlalchemy import Unicode
1.832441
2
neat_yet_again/neat/relation.py
tilezen/neat
0
6632141
<gh_stars>0 # a relation in the algebraic data model class Relation(object): def __init__(self, attribute_names, tuples=None): self.attribute_names = attribute_names if tuples: for t in tuples: assert len(t) == len(self.attribute_names), \ "Relation ...
# a relation in the algebraic data model class Relation(object): def __init__(self, attribute_names, tuples=None): self.attribute_names = attribute_names if tuples: for t in tuples: assert len(t) == len(self.attribute_names), \ "Relation tuple %r inc...
en
0.888294
# a relation in the algebraic data model
3.48145
3
crud.py
HB-LAND/pour-decisions
3
6632142
<gh_stars>1-10 """CRUD operations.""" from model import db, connect_to_db, User, Wine, Cheese, Pair, Rating def create_user(fname, lname, email, password): """Create and return a new user""" user = User(fname=fname, lname=lname, email=email, password=password) db.session.add(user) db.s...
"""CRUD operations.""" from model import db, connect_to_db, User, Wine, Cheese, Pair, Rating def create_user(fname, lname, email, password): """Create and return a new user""" user = User(fname=fname, lname=lname, email=email, password=password) db.session.add(user) db.session.commit()...
en
0.927473
CRUD operations. Create and return a new user Create and return a wine. Create and return a cheese. Creates a paired wine and cheese based on a user's selection Creates a rating based on a user's like or dislike of a wine and cheese pairing
3.561166
4
setup.py
zedshaw/zapps
2
6632143
## this file is generated from settings in build.vel try: from setuptools import setup except ImportError: from distutils.core import setup # from options["setup"] in build.vel config = {'description': 'A book compiler for programmers where code and prose are separate.', 'author': '<NAME>', 'author_email': '<...
## this file is generated from settings in build.vel try: from setuptools import setup except ImportError: from distutils.core import setup # from options["setup"] in build.vel config = {'description': 'A book compiler for programmers where code and prose are separate.', 'author': '<NAME>', 'author_email': '<...
en
0.941835
## this file is generated from settings in build.vel # from options["setup"] in build.vel
1.352238
1
setup.py
RichardScottOZ/subsurface
1
6632144
# -*- coding: utf 8 -*- """ Python installation file. """ from os import path from setuptools import setup, find_packages import re this_directory = path.abspath(path.dirname(__file__)) verstr = '0.1.0' VERSIONFILE = path.join(this_directory, "subsurface", "_version.py") with open(VERSIONFILE, 'r', encoding='utf-8')a...
# -*- coding: utf 8 -*- """ Python installation file. """ from os import path from setuptools import setup, find_packages import re this_directory = path.abspath(path.dirname(__file__)) verstr = '0.1.0' VERSIONFILE = path.join(this_directory, "subsurface", "_version.py") with open(VERSIONFILE, 'r', encoding='utf-8')a...
en
0.61688
# -*- coding: utf 8 -*- Python installation file.
1.755898
2
Shivarj-Jadhav/code.py
Shivraj-Jadhav/greyatom-python-for-data-science
0
6632145
<gh_stars>0 # -------------- #Importing header files import pandas as pd import numpy as np import matplotlib.pyplot as plt data= pd.read_csv(path) loan_status=data['Loan_Status'].value_counts() plt.bar(loan_status.index, loan_status) plt.show() #Code starts here # -------------- #Code starts here proper...
# -------------- #Importing header files import pandas as pd import numpy as np import matplotlib.pyplot as plt data= pd.read_csv(path) loan_status=data['Loan_Status'].value_counts() plt.bar(loan_status.index, loan_status) plt.show() #Code starts here # -------------- #Code starts here property_and_loan=...
en
0.360972
# -------------- #Importing header files #Code starts here # -------------- #Code starts here # -------------- #Code starts here # -------------- #Code starts here #For automatic legend display # -------------- #Code starts here
2.95295
3
hubspot/crm/timeline/api/events_api.py
fakepop/hubspot-api-python
0
6632146
<filename>hubspot/crm/timeline/api/events_api.py # coding: utf-8 """ Timeline events This feature allows an app to create and configure custom events that can show up in the timelines of certain CRM objects like contacts, companies, tickets, or deals. You'll find multiple use cases for this API in the section...
<filename>hubspot/crm/timeline/api/events_api.py # coding: utf-8 """ Timeline events This feature allows an app to create and configure custom events that can show up in the timelines of certain CRM objects like contacts, companies, tickets, or deals. You'll find multiple use cases for this API in the section...
en
0.698287
# coding: utf-8 Timeline events This feature allows an app to create and configure custom events that can show up in the timelines of certain CRM objects like contacts, companies, tickets, or deals. You'll find multiple use cases for this API in the sections below. # noqa: E501 The version of the OpenAPI doc...
2.340574
2
example/random_.py
iamaris/ppf
2
6632147
import random, sys, getopt def _print_gauss(): g = random.Random(1234) print [g.gauss(mu = 0, sigma = 1) for i in range(100)] def _print_lognormal_variate(): g = random.Random(1234) print [g.lognormvariate(mu = 0, sigma = 1) for i in range(100)] def _usage(): print "usage: %s" % sys.argv[0] print "Try `p...
import random, sys, getopt def _print_gauss(): g = random.Random(1234) print [g.gauss(mu = 0, sigma = 1) for i in range(100)] def _print_lognormal_variate(): g = random.Random(1234) print [g.lognormvariate(mu = 0, sigma = 1) for i in range(100)] def _usage(): print "usage: %s" % sys.argv[0] print "Try `p...
none
1
2.682816
3
src/alembic_utils/depends.py
tdamsma/alembic_utils
74
6632148
import logging from contextlib import contextmanager from typing import Generator, List from sqlalchemy import exc as sqla_exc from sqlalchemy.orm import Session from alembic_utils.simulate import simulate_entity logger = logging.getLogger(__name__) def solve_resolution_order(sess: Session, entities): """Solve...
import logging from contextlib import contextmanager from typing import Generator, List from sqlalchemy import exc as sqla_exc from sqlalchemy.orm import Session from alembic_utils.simulate import simulate_entity logger = logging.getLogger(__name__) def solve_resolution_order(sess: Session, entities): """Solve...
en
0.86706
Solve for an entity resolution order that increases the probability that a migration will suceed if, for example, two new views are created and one refers to the other This strategy will only solve for simple cases # Resolve the entities with 0 dependencies first (faster) # Resolve entities with possible d...
2.307106
2
gltf2usd/_gltf2usd/gltf2/Animation.py
beta-uy/gltf2usd
0
6632149
<gh_stars>0 from bisect import bisect_left from ..gltf2usdUtils import GLTF2USDUtils from pxr import Gf class AnimationSampler: def __init__(self, sampler_entry, animation): self._animation = animation self._input_accessor_index = sampler_entry['input'] self._input_accessor = self._animat...
from bisect import bisect_left from ..gltf2usdUtils import GLTF2USDUtils from pxr import Gf class AnimationSampler: def __init__(self, sampler_entry, animation): self._animation = animation self._input_accessor_index = sampler_entry['input'] self._input_accessor = self._animation._gltf_lo...
en
0.257953
#translation or scale interpolation #quaternion interpolation #translation or scale interpolation #quaternion interpolation
2.288265
2
tests/conftest.py
cardano-community/koios-artifacts
1
6632150
#!/usr/bin/env python3 import pytest import schemathesis def pytest_addoption(parser): parser.addoption( "--local-url", action="store", default="http://127.0.0.1:8053/api/v0" ) parser.addoption( "--compare-url", action="store", default="https://guild.koios.rest/api/v0" ) parser.add...
#!/usr/bin/env python3 import pytest import schemathesis def pytest_addoption(parser): parser.addoption( "--local-url", action="store", default="http://127.0.0.1:8053/api/v0" ) parser.addoption( "--compare-url", action="store", default="https://guild.koios.rest/api/v0" ) parser.add...
fr
0.221828
#!/usr/bin/env python3
2.017432
2