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
jdBuyMask/message.py
Ellison997/Scampering
357
6629051
# -*- encoding=utf8 -*- from jdEmail import sendMail from wechat_ftqq import sendWechat class message(object): """消息推送类""" def __init__(self, messageType, sc_key, mail): if messageType == '2': if not sc_key: raise Exception('sc_key can not be empty') self.sc_ke...
# -*- encoding=utf8 -*- from jdEmail import sendMail from wechat_ftqq import sendWechat class message(object): """消息推送类""" def __init__(self, messageType, sc_key, mail): if messageType == '2': if not sc_key: raise Exception('sc_key can not be empty') self.sc_ke...
ja
0.284897
# -*- encoding=utf8 -*- 消息推送类
2.707801
3
edition/parsing/fortran/fortran_file_parser.py
Manu343726/biicode-common
17
6629052
from biicode.common.edition.parsing.file_parser import FileParser from biicode.common.utils.bii_logging import logger import re from biicode.common.edition.parsing.code_reference import CodeReference from biicode.common.edition.parsing.fortran.fortran_code_ref import FItem class FortranFileParser(FileParser): CA...
from biicode.common.edition.parsing.file_parser import FileParser from biicode.common.utils.bii_logging import logger import re from biicode.common.edition.parsing.code_reference import CodeReference from biicode.common.edition.parsing.fortran.fortran_code_ref import FItem class FortranFileParser(FileParser): CA...
en
0.567835
#|"|!|/[*]|subroutine |module |call |use |include ') # +2, -1 to account for // and line ending
2.347856
2
sdk/python-sdk/test/protocols/test_CommitedAnswer.py
madhugoundla-attributes/samplewebapp
40
6629053
<reponame>madhugoundla-attributes/samplewebapp<gh_stars>10-100 import pytest from test.test_utils import get_test_config, cleanup from verity_sdk.protocols.v1_0.CommittedAnswer import CommittedAnswer from verity_sdk.utils import COMMUNITY_MSG_QUALIFIER from verity_sdk.utils.Context import Context for_relationship = '...
import pytest from test.test_utils import get_test_config, cleanup from verity_sdk.protocols.v1_0.CommittedAnswer import CommittedAnswer from verity_sdk.utils import COMMUNITY_MSG_QUALIFIER from verity_sdk.utils.Context import Context for_relationship = 'some_did' question_text = 'Are you trying to login to acme.com?...
none
1
2.230734
2
scripts/mgear/maya/shifter/component/guide.py
KRNKRS/mgear
94
6629054
<reponame>KRNKRS/mgear<gh_stars>10-100 """ Shifter's Component guide class. """ from functools import partial import maya.cmds as cmds # pyMel import pymel.core as pm from pymel.core import datatypes # mgear import mgear from mgear import string from mgear.maya import dag, vector, transform, applyop, attribute, cu...
""" Shifter's Component guide class. """ from functools import partial import maya.cmds as cmds # pyMel import pymel.core as pm from pymel.core import datatypes # mgear import mgear from mgear import string from mgear.maya import dag, vector, transform, applyop, attribute, curve, icon from mgear.maya.shifter impo...
en
0.616415
Shifter's Component guide class. # pyMel # mgear ########################################################## # COMPONENT GUIDE ########################################################## Main class for component guide creation. This class handles all the parameters and objectDefs creation. It also know how to pa...
2.19497
2
src/spaceone/statistics/scheduler/stat_hourly_scheduler.py
choonho/statistics
0
6629055
import consul import datetime import logging import time from spaceone.core import config from spaceone.core.locator import Locator from spaceone.core.scheduler import HourlyScheduler from spaceone.core.auth.jwt.jwt_util import JWTUtil __all__ = ['StatHourlyScheduler'] _LOGGER = logging.getLogger(__name__) def _ge...
import consul import datetime import logging import time from spaceone.core import config from spaceone.core.locator import Locator from spaceone.core.scheduler import HourlyScheduler from spaceone.core.auth.jwt.jwt_util import JWTUtil __all__ = ['StatHourlyScheduler'] _LOGGER = logging.getLogger(__name__) def _ge...
en
0.512938
# seconds for waiting queue initialization # get current time # Last check_count time # index # previous hour # start time of push_token # end time of execution in this tick # self.check_global_configuration() # ERROR LOGGING # Loop all domain, then find schedule # check current count is correct or not # check # This i...
1.97336
2
cliente2.py
megaserch/untornolam-cnc
0
6629056
#!/usr/bin/env python '''from socketIO_client import SocketIO, BaseNamespace class Namespace(BaseNamespace): def on_connect(self): print('[Connected]') def on_reconnect(self): print('[Reconnected]') def on_disconnect(self): print('[Disconnected]') socketIO = SocketIO('192.168.3...
#!/usr/bin/env python '''from socketIO_client import SocketIO, BaseNamespace class Namespace(BaseNamespace): def on_connect(self): print('[Connected]') def on_reconnect(self): print('[Reconnected]') def on_disconnect(self): print('[Disconnected]') socketIO = SocketIO('192.168.3...
en
0.216155
#!/usr/bin/env python from socketIO_client import SocketIO, BaseNamespace class Namespace(BaseNamespace): def on_connect(self): print('[Connected]') def on_reconnect(self): print('[Reconnected]') def on_disconnect(self): print('[Disconnected]') socketIO = SocketIO('192.168.3.11'...
3.086387
3
python/paddle/v2/fluid/tests/test_split_and_merge_lod_tensor_op.py
jczaja/Paddle
1
6629057
<reponame>jczaja/Paddle # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. # # 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 (c) 2018 PaddlePaddle Authors. All Rights Reserve. # # 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...
en
0.851907
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. # # 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...
2.10178
2
src/agent.py
misterdev/flatland-marl
9
6629058
import copy import os import random from collections import namedtuple, deque, Iterable import numpy as np import torch import torch.nn.functional as F import torch.optim as optim from src.model import Dueling_DQN device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") print(device) class DQNAgent:...
import copy import os import random from collections import namedtuple, deque, Iterable import numpy as np import torch import torch.nn.functional as F import torch.optim as optim from src.model import Dueling_DQN device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") print(device) class DQNAgent:...
en
0.731392
Interacts with and learns from the environment. Initialize an Agent object. Params ====== state_size (int): dimension of each state action_space (int): dimension of each action # self.state_size = state_size # used by the network, not the algorithm # Bitmap width # num altmaps (3) x max num rails # Q-Network...
2.329998
2
functions/Exercises/add_nums.py
WebucatorTraining/classfiles-actionable-python
2
6629059
<reponame>WebucatorTraining/classfiles-actionable-python def add_3_and_6(): total = 3 + 6 print('3 + 6 = ', total) def add_10_and_12(): total = 10 + 12 print('10 + 12 = ', total) def main(): add_3_and_6() add_10_and_12() main()
def add_3_and_6(): total = 3 + 6 print('3 + 6 = ', total) def add_10_and_12(): total = 10 + 12 print('10 + 12 = ', total) def main(): add_3_and_6() add_10_and_12() main()
none
1
3.625712
4
tests/test_pretrained.py
kunosato-mado/ttslearn
146
6629060
from pathlib import Path import numpy as np import pytest from scipy.io import wavfile from tqdm.auto import tqdm from ttslearn.pretrained import ( create_tts_engine, get_available_model_ids, is_pretrained_model_ready, retrieve_pretrained_model, ) OUT_DIR = Path(__file__).parent / "out_dir" OUT_DIR.mk...
from pathlib import Path import numpy as np import pytest from scipy.io import wavfile from tqdm.auto import tqdm from ttslearn.pretrained import ( create_tts_engine, get_available_model_ids, is_pretrained_model_ready, retrieve_pretrained_model, ) OUT_DIR = Path(__file__).parent / "out_dir" OUT_DIR.mk...
en
0.778727
# warmup # should exist # I wish... # warmup # shouldn't raise # Test if the results sound okay. Check the generated wav files after running the test
2.397494
2
task 3.py
someshkr/Assignment-3
0
6629061
import numpy as np def vander_matrix(ip_vector, n, increasing = True): if not increasing: op_matrix = np.array([x ** i for x in ip_vector for i in range(n)]).reshape(ip_vector.size, n) else: return 1 return op_matrix input =np.array([1,2,3]) col = 3 op_mat = vander_matrix(input,col,Fal...
import numpy as np def vander_matrix(ip_vector, n, increasing = True): if not increasing: op_matrix = np.array([x ** i for x in ip_vector for i in range(n)]).reshape(ip_vector.size, n) else: return 1 return op_matrix input =np.array([1,2,3]) col = 3 op_mat = vander_matrix(input,col,Fal...
none
1
3.436508
3
gfg/graphs/bellman_ford.py
rrwt/daily-coding-challenge
1
6629062
<filename>gfg/graphs/bellman_ford.py """ Given a graph and a source vertex src in graph, find shortest paths from src to all vertices in the given graph. The graph may contain negative weight edges. Dijkstra does not work for Graphs with negative weight edges, Bellman-Ford works for such graphs. Bellman-Ford is also s...
<filename>gfg/graphs/bellman_ford.py """ Given a graph and a source vertex src in graph, find shortest paths from src to all vertices in the given graph. The graph may contain negative weight edges. Dijkstra does not work for Graphs with negative weight edges, Bellman-Ford works for such graphs. Bellman-Ford is also s...
en
0.892333
Given a graph and a source vertex src in graph, find shortest paths from src to all vertices in the given graph. The graph may contain negative weight edges. Dijkstra does not work for Graphs with negative weight edges, Bellman-Ford works for such graphs. Bellman-Ford is also simpler than Dijkstra and suites well for ...
3.697291
4
importkit/import_/__init__.py
sprymix/importkit
2
6629063
<filename>importkit/import_/__init__.py<gh_stars>1-10 ## # Copyright (c) 2008-2012 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## import imp import importlib import os import sys from .context import ImportContext from .finder import install, update_finders, register_package class ObjectImpor...
<filename>importkit/import_/__init__.py<gh_stars>1-10 ## # Copyright (c) 2008-2012 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## import imp import importlib import os import sys from .context import ImportContext from .finder import install, update_finders, register_package class ObjectImpor...
en
0.68045
## # Copyright (c) 2008-2012 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ##
2.145831
2
rhprocessor/controls.py
rhodief/rhprocessor
0
6629064
<filename>rhprocessor/controls.py from typing import Any, Dict, Iterable, List from datetime import datetime import copy from enum import Enum, auto class ACTION_TYPE(Enum): CHECKIN_NODE = auto() CHECKIN_FN = auto() START = auto() END = auto() CHECKOUT_FN = auto() CHECKOUT_NODE = auto() LO...
<filename>rhprocessor/controls.py from typing import Any, Dict, Iterable, List from datetime import datetime import copy from enum import Enum, auto class ACTION_TYPE(Enum): CHECKIN_NODE = auto() CHECKIN_FN = auto() START = auto() END = auto() CHECKOUT_FN = auto() CHECKOUT_NODE = auto() LO...
pt
0.483531
#print('_list', _list.to_dict()) ## disabled ### Quando se tornar filhos, ele tem um ID... ## the children will use this.
2.270547
2
app/service/operation_svc.py
gaybro8777/caldera
0
6629065
import asyncio import json import os import traceback from importlib import import_module from app.service.base_service import BaseService class OperationService(BaseService): def __init__(self): self.loop = asyncio.get_event_loop() self.log = self.add_service('operation_svc', self) self...
import asyncio import json import os import traceback from importlib import import_module from app.service.base_service import BaseService class OperationService(BaseService): def __init__(self): self.loop = asyncio.get_event_loop() self.log = self.add_service('operation_svc', self) self...
en
0.894415
Resume an operation that was stopped :return: None Perform all close actions for an operation :param operation: :return: None Run a new operation :param op_id: :return: None Create a new operation report and write it to the logs directory :param op_id: :return: a ...
2.411823
2
data_steward/test/unit_test/test_util.py
t-abdul-basser/curation
0
6629066
<filename>data_steward/test/unit_test/test_util.py import os import common import gcs_utils import resources from validation import main FAKE_HPO_ID = 'fake' VALIDATE_HPO_FILES_URL = main.PREFIX + 'ValidateHpoFiles/' + FAKE_HPO_ID COPY_HPO_FILES_URL = main.PREFIX + 'CopyFiles/' + FAKE_HPO_ID TEST_DATA_PATH = os.path....
<filename>data_steward/test/unit_test/test_util.py import os import common import gcs_utils import resources from validation import main FAKE_HPO_ID = 'fake' VALIDATE_HPO_FILES_URL = main.PREFIX + 'ValidateHpoFiles/' + FAKE_HPO_ID COPY_HPO_FILES_URL = main.PREFIX + 'CopyFiles/' + FAKE_HPO_ID TEST_DATA_PATH = os.path....
en
0.791253
# Test files for five person sample # OMOP NYC and PITT test data from synpuf Generate the expected result payload for five_persons data set. For internal testing only. Utility to create response test payloads Remove all non-vocabulary tables from a dataset :param dataset_id: ID of the dataset with the tables to d...
2.175757
2
backend/src/baserow/contrib/database/views/view_types.py
calvinchengx/baserow
0
6629067
from django.urls import path, include from .registries import ViewType from .models import GridView class GridViewType(ViewType): type = 'grid' model_class = GridView def get_api_urls(self): from baserow.contrib.database.api.views.grid import urls as api_urls return [ path('...
from django.urls import path, include from .registries import ViewType from .models import GridView class GridViewType(ViewType): type = 'grid' model_class = GridView def get_api_urls(self): from baserow.contrib.database.api.views.grid import urls as api_urls return [ path('...
none
1
2.090673
2
trove_dashboard/content/databases/tabs.py
NeCTAR-RC/trove-dashboard
0
6629068
<gh_stars>0 # Copyright 2013 Rackspace Hosting # # 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...
# Copyright 2013 Rackspace Hosting # # 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.83592
# Copyright 2013 Rackspace Hosting # # 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.64061
2
wxmplot/imageconf.py
jkbgbr/wxmplot
0
6629069
<reponame>jkbgbr/wxmplot import wx import wx.lib.agw.flatnotebook as flat_nb import wx.lib.scrolledpanel as scrolled import wx.lib.colourselect as csel from math import log10 import numpy as np import matplotlib.cm as cmap from matplotlib.ticker import FuncFormatter from .colors import register_custom_colormaps, he...
import wx import wx.lib.agw.flatnotebook as flat_nb import wx.lib.scrolledpanel as scrolled import wx.lib.colourselect as csel from math import log10 import numpy as np import matplotlib.cm as cmap from matplotlib.ticker import FuncFormatter from .colors import register_custom_colormaps, hexcolor, hex2rgb, mpl_colo...
en
0.709762
home built tick formatter to use with FuncFormatter(): x value to be formatted type 'x' or 'y' or 'y2' to set which list of ticks to get also sets self._yfmt/self._xfmt for statusbar transforms image from RGB with (0,0,0) showing black to RGB with 0,0,0 showing white take...
1.734589
2
test/python/test_skip_transpiler.py
biryani/qiskit-terra
0
6629070
<reponame>biryani/qiskit-terra<filename>test/python/test_skip_transpiler.py # -*- coding: utf-8 -*- # Copyright 2018, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. # pylint: disable=missing-docstring, redefined-bu...
# -*- coding: utf-8 -*- # Copyright 2018, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. # pylint: disable=missing-docstring, redefined-builtin import unittest from qiskit import QuantumRegister, ClassicalRegister...
en
0.821383
# -*- coding: utf-8 -*- # Copyright 2018, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. # pylint: disable=missing-docstring, redefined-builtin Test compilation with skip translation. Test compile with and without sk...
1.972909
2
publishconf.py
zentropi/zentropi.org
0
6629071
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * # If your site is available via HTTPS, make sure SITEURL...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * # If your site is available via HTTPS, make sure SITEURL...
en
0.769843
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is only used if you use `make publish` or # explicitly specify it as your config file. # If your site is available via HTTPS, make sure SITEURL begins with https:// # Following items are often useful when publishing #DISQUS_SITENAME = "" #GOOGLE_ANALYTICS = ""
1.483552
1
nurses/widgets/widget.py
salt-die/nurses
21
6629072
from collections import defaultdict import curses from ..observable import Observable BORDER_STYLES = { "light" : "┌┐│─└┘", "heavy" : "┏┓┃━┗┛", "double": "╔╗║═╚╝", "curved": "╭╮│─╰╯", } class BindMagic: """ Decorator that binds a method to attributes. Attributes in `attrs` that aren't Obse...
from collections import defaultdict import curses from ..observable import Observable BORDER_STYLES = { "light" : "┌┐│─└┘", "heavy" : "┏┓┃━┗┛", "double": "╔╗║═╚╝", "curved": "╭╮│─╰╯", } class BindMagic: """ Decorator that binds a method to attributes. Attributes in `attrs` that aren't Obse...
en
0.800076
Decorator that binds a method to attributes. Attributes in `attrs` that aren't Observable will be redefined as Observables. Warning! This is a very abusive way to use the automatic calling of `__set_name__` in the descriptor protocol. # default value of Observable will come from base.__dict__ This metaclass simpl...
3.177374
3
pydoccano/features.py
evstratbg/pydoccano
2
6629073
from requests import Session from .base_api import BaseApi class Features(BaseApi): def __init__(self, base_url: str, session: Session, version='v1'): super().__init__(base_url) self.session = session self.version = version self.base_endpoint = f"{self.version}/features" def ...
from requests import Session from .base_api import BaseApi class Features(BaseApi): def __init__(self, base_url: str, session: Session, version='v1'): super().__init__(base_url) self.session = session self.version = version self.base_endpoint = f"{self.version}/features" def ...
none
1
2.620952
3
pixiedust/utils/sparkJobProgressMonitor.py
jordangeorge/pixiedust
0
6629074
# ------------------------------------------------------------------------------- # Copyright IBM Corp. 2017 # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
# ------------------------------------------------------------------------------- # Copyright IBM Corp. 2017 # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
en
0.676955
# ------------------------------------------------------------------------------- # Copyright IBM Corp. 2017 # # 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...
1.493569
1
deploy/unet/app.py
SchiffFlieger/semantic-segmentation-master-thesis
1
6629075
import os import glob import math import cv2 import numpy as np from tensorflow.keras.models import load_model INPUT_TILE_SIZE = 572 PREDICTION_TILE_SIZE = 388 # color values for the segmentation categories LABEL_RGB_VALUES = [ (3, 0, 208), # buildings (240, 126, 11), # water (40, 171, 44), # forest ...
import os import glob import math import cv2 import numpy as np from tensorflow.keras.models import load_model INPUT_TILE_SIZE = 572 PREDICTION_TILE_SIZE = 388 # color values for the segmentation categories LABEL_RGB_VALUES = [ (3, 0, 208), # buildings (240, 126, 11), # water (40, 171, 44), # forest ...
en
0.6506
# color values for the segmentation categories # buildings # water # forest # traffic # urban greens # agriculture
2.705748
3
2018/day11.py
tcbegley/advent-of-code
6
6629076
import sys def get_power_level(x, y, s): rid = x + 10 pl = rid * y pl += s pl *= rid pl = (pl % 1000) // 100 return pl - 5 def answer(serial_no): grid = [[None] * 300 for _ in range(300)] for i in range(300): for j in range(300): grid[i][j] = get_power_level(i, j...
import sys def get_power_level(x, y, s): rid = x + 10 pl = rid * y pl += s pl *= rid pl = (pl % 1000) // 100 return pl - 5 def answer(serial_no): grid = [[None] * 300 for _ in range(300)] for i in range(300): for j in range(300): grid[i][j] = get_power_level(i, j...
none
1
3.390945
3
station/types/test/test_cpa.py
jawaad-ahmad/brata.station
0
6629077
# ------------------------------------------------------------------------------ # 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 r...
# ------------------------------------------------------------------------------ # 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 r...
en
0.293659
# ------------------------------------------------------------------------------ # 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 r...
1.583886
2
plugin.video.saltsrd.lite/scrapers/moviexk_scraper.py
TheWardoctor/wardoctors-repo
1
6629078
<reponame>TheWardoctor/wardoctors-repo """ SALTS XBMC Addon Copyright (C) 2014 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at...
""" SALTS XBMC Addon Copyright (C) 2014 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
en
0.848027
SALTS XBMC Addon Copyright (C) 2014 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This prog...
2.041807
2
Dataset/Leetcode/train/27/503.py
kkcookies99/UAST
0
6629079
<reponame>kkcookies99/UAST<gh_stars>0 class Solution: def XXX(self, nums: List[int], val: int) -> int: if not nums: return 0 a = nums.count(val) for i in range(a): nums.remove(val) return len(nums) undefined for (i = 0; i < document.getElementsByTa...
class Solution: def XXX(self, nums: List[int], val: int) -> int: if not nums: return 0 a = nums.count(val) for i in range(a): nums.remove(val) return len(nums) undefined for (i = 0; i < document.getElementsByTagName("code").length; i++) { consol...
none
1
3.211338
3
aristotle/apps/marc/bots/awbots.py
jermnelson/Discover-Aristotle
7
6629080
""" awbots.py - American West Bots for automating American West MARC record loads """ __author__ = '<NAME>' from marcbots import MARCImportBot PROXY_LOCATION='0-www.americanwest.amdigital.co.uk.tiger.coloradocollege.edu' class AmericanWestBot(MARCImportBot): """ The `AmericanWestBot` reads MARC records from...
""" awbots.py - American West Bots for automating American West MARC record loads """ __author__ = '<NAME>' from marcbots import MARCImportBot PROXY_LOCATION='0-www.americanwest.amdigital.co.uk.tiger.coloradocollege.edu' class AmericanWestBot(MARCImportBot): """ The `AmericanWestBot` reads MARC records from...
en
0.732371
awbots.py - American West Bots for automating American West MARC record loads The `AmericanWestBot` reads MARC records from American West Database, validates adds/modify fields for a new import MARC file for loading into TIGER Initializes `AmericanWestBot` for conversion process. :param marc_fi...
2.817343
3
Cython&OpenMP/fopenmp/setup.py
SuperbTUM/CV-newcomer
0
6629081
<filename>Cython&OpenMP/fopenmp/setup.py from distutils.core import setup, Extension from Cython.Build import cythonize import numpy as np compile_args = ['-std=c++11', '-fopenmp'] linker_flags = ['-fopenmp'] module = Extension('scratch', ['scratch.pyx'], language='c++', ...
<filename>Cython&OpenMP/fopenmp/setup.py from distutils.core import setup, Extension from Cython.Build import cythonize import numpy as np compile_args = ['-std=c++11', '-fopenmp'] linker_flags = ['-fopenmp'] module = Extension('scratch', ['scratch.pyx'], language='c++', ...
none
1
1.479364
1
code/507.py
Nightwish-cn/my_leetcode
23
6629082
<reponame>Nightwish-cn/my_leetcode class Solution: def checkPerfectNumber(self, num): """ :type num: int :rtype: bool """ i, sum = 1, -num while i * i < num: if num % i == 0: sum += i + num // i i += 1 if i * i == num: ...
class Solution: def checkPerfectNumber(self, num): """ :type num: int :rtype: bool """ i, sum = 1, -num while i * i < num: if num % i == 0: sum += i + num // i i += 1 if i * i == num: sum += i return ...
en
0.209607
:type num: int :rtype: bool
3.416177
3
ext/pynd-lib/pynd/segutils.py
thomshaw92/Atlas-GAN
107
6629083
''' nd segmentation (label map) utilities Contact: <EMAIL> ''' import numpy as np from . import ndutils as nd def seg2contour(seg, exclude_zero=True, contour_type='inner', thickness=1): ''' transform nd segmentation (label maps) to contour maps Parameters ---------- seg : nd array volume...
''' nd segmentation (label map) utilities Contact: <EMAIL> ''' import numpy as np from . import ndutils as nd def seg2contour(seg, exclude_zero=True, contour_type='inner', thickness=1): ''' transform nd segmentation (label maps) to contour maps Parameters ---------- seg : nd array volume...
en
0.663201
nd segmentation (label map) utilities Contact: <EMAIL> transform nd segmentation (label maps) to contour maps Parameters ---------- seg : nd array volume of labels/segmentations exclude_zero : optional logical whether to exclude the zero label. default True contour_type : s...
3.068283
3
wrapper.py
Neubias-WG5/W_ObjectTracking-PAST-FR
0
6629084
import os import shutil import sys from subprocess import call from cytomine.models import Job from neubiaswg5 import CLASS_OBJTRK from neubiaswg5.helpers import NeubiasJob, prepare_data, upload_data, upload_metrics, get_discipline def main(argv): # 0. Initialize Cytomine client and job if necessary and parse inp...
import os import shutil import sys from subprocess import call from cytomine.models import Job from neubiaswg5 import CLASS_OBJTRK from neubiaswg5.helpers import NeubiasJob, prepare_data, upload_data, upload_metrics, get_discipline def main(argv): # 0. Initialize Cytomine client and job if necessary and parse inp...
en
0.548632
# 0. Initialize Cytomine client and job if necessary and parse inputs # 1. Create working directories on the machine # 2. Download the images # 3. Call the image analysis workflow using the run script # DEBUG Workflow not currently working !! # # CellTrackingChallenge expects the protocol to start with the data folder ...
2.126377
2
model.py
GetThereSafe/gettheresafe
1
6629085
from main import db class Coord(db.Model): id = db.Column(db.Integer, primary_key=True) lng = db.Column(db.Float) lat = db.Column(db.Float) def __init__(self, lng, lat): self.lng = lng self.lat = lat
from main import db class Coord(db.Model): id = db.Column(db.Integer, primary_key=True) lng = db.Column(db.Float) lat = db.Column(db.Float) def __init__(self, lng, lat): self.lng = lng self.lat = lat
none
1
2.851807
3
python-code/opencv-learning/dnn/tensorflow-face-recognition.py
juxiangwu/image-processing
13
6629086
import tensorflow as tf import numpy as np import cv2 cap = cv2.VideoCapture(1) face_cascade = cv2.CascadeClassifier('/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml') while True: ret, frame = cap.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) faces = face_cascade.detectMultiScale(gray,...
import tensorflow as tf import numpy as np import cv2 cap = cv2.VideoCapture(1) face_cascade = cv2.CascadeClassifier('/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml') while True: ret, frame = cap.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) faces = face_cascade.detectMultiScale(gray,...
en
0.786779
# Read in the image_data #load retrained label data #load retrained graph # Feed the image_data as input to the graph and get first prediction # Sort to show labels of first prediction in order of confidence #show video stream
2.949202
3
draw-figs.py
rofuyu/exp-gmips-nips17
5
6629087
<filename>draw-figs.py<gh_stars>1-10 #!/usr/bin/env python import sys from os import path import os from data_info import * #BASIC Options #TITLE = 'data size v.s. ROC' XLABEL = 'updates' XLABEL = 'time' #XLABEL = 'rank' XLABEL = 'cputime' XLABEL = 'iter' XLABEL = 'walltime' XLABEL = 'time' YLABEL = r'obj' YLABEL =...
<filename>draw-figs.py<gh_stars>1-10 #!/usr/bin/env python import sys from os import path import os from data_info import * #BASIC Options #TITLE = 'data size v.s. ROC' XLABEL = 'updates' XLABEL = 'time' #XLABEL = 'rank' XLABEL = 'cputime' XLABEL = 'iter' XLABEL = 'walltime' XLABEL = 'time' YLABEL = r'obj' YLABEL =...
en
0.199459
#!/usr/bin/env python #BASIC Options #TITLE = 'data size v.s. ROC' #XLABEL = 'rank' #x = map(float, x) #curves[i][1] = [float(s)*(iter+1)/x for iter, x in enumerate(curves[i][1])] #matplotlib.rc('text',usetex=True) #pylab.axhline(y=hline, lw=1, c='gray', marker='.') #change 'plot' to 'semilogx'/'semilogy'/'loglog' if y...
2.359351
2
Sofware/navigation.py
Mark-MDO47/PiPod
63
6629088
import csv class menu(): menuDict = { "selectedItem": 0, "Main": ["Music", "Settings"], # ["Music", "Scripts", "Settings"] "Music": ["Artists", "Albums", "Tracks", "Queue"], "Scripts": [], "Artists": [], "Albums": [], "Tracks": [], "list": [], ...
import csv class menu(): menuDict = { "selectedItem": 0, "Main": ["Music", "Settings"], # ["Music", "Scripts", "Settings"] "Music": ["Artists", "Albums", "Tracks", "Queue"], "Scripts": [], "Artists": [], "Albums": [], "Tracks": [], "list": [], ...
en
0.812907
# ["Music", "Scripts", "Settings"] # check if history is empty # move selected item to queue # move selected artist to queue # move selected album to queue # copy the list where the song is selected to the queue # Remove selected # Put selected at first position # check if empty # update history # go to next menu # [fi...
3.612006
4
Projects/Client-Server-Application/utils/unpriv_port.py
CristianCotovanu/PCom
0
6629089
<reponame>CristianCotovanu/PCom<gh_stars>0 MIN_VALUE = 1024 MAX_VALUE = 65535 def unprivileged_port_type(value, min_value=1024, max_value=MAX_VALUE): try: int_value = int(value) except ValueError: raise ValueError('The port should be an integer.') if (int_value >= min_value) and (int_valu...
MIN_VALUE = 1024 MAX_VALUE = 65535 def unprivileged_port_type(value, min_value=1024, max_value=MAX_VALUE): try: int_value = int(value) except ValueError: raise ValueError('The port should be an integer.') if (int_value >= min_value) and (int_value <= max_value): return int_value ...
none
1
3.414111
3
simulation.py
doubianimehdi/DataEngineerUberBootCamp
0
6629090
<gh_stars>0 """ Ce dummy producer va récupérer des trajets en 2019-03 à la même heure, minute et seconde afin de simuler des trajets effectués en réel. """ import os import sys import json import time import warnings import pandas as pd import logging from datetime import datetime, timedelta from confluent_kafka impo...
""" Ce dummy producer va récupérer des trajets en 2019-03 à la même heure, minute et seconde afin de simuler des trajets effectués en réel. """ import os import sys import json import time import warnings import pandas as pd import logging from datetime import datetime, timedelta from confluent_kafka import avro from...
en
0.119256
Ce dummy producer va récupérer des trajets en 2019-03 à la même heure, minute et seconde afin de simuler des trajets effectués en réel. # TODO : Remplacer par le serveur Confluent # On ne peut pas sérialiser par défaut un DateTime Python # Les colonnes sources du fichier # Les colonnes cibles dans BigQuery # On récupèr...
2.030288
2
users/models.py
mcfa77y/festival-playlist-generator
0
6629091
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.contrib.auth.models import AbstractUser from django.db import models # from django.utils.translation import ugettext_lazy as _ class User(AbstractUser): # First Name and Last Name do not cover name patterns # around...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.contrib.auth.models import AbstractUser from django.db import models # from django.utils.translation import ugettext_lazy as _ class User(AbstractUser): # First Name and Last Name do not cover name patterns # around...
en
0.798878
# -*- coding: utf-8 -*- # from django.utils.translation import ugettext_lazy as _ # First Name and Last Name do not cover name patterns # around the globe.
2.035268
2
subjects/forms.py
rafaelmadaloz/i18n-scholl-system
88
6629092
from django.forms import ModelForm from django import forms from .models import Subject, SubjectCombination class SubjectForm(ModelForm): class Meta: model = Subject fields = ['subject_name', 'subject_code'] widgets = { 'subject_name': forms.TextInput(attrs={'class': 'form-contr...
from django.forms import ModelForm from django import forms from .models import Subject, SubjectCombination class SubjectForm(ModelForm): class Meta: model = Subject fields = ['subject_name', 'subject_code'] widgets = { 'subject_name': forms.TextInput(attrs={'class': 'form-contr...
none
1
2.275002
2
lib/oci_utils/migrate/system_tools.py
totalamateurhour/oci-utils
1
6629093
# oci-utils # # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved. # Licensed under the Universal Permissive License v 1.0 as shown # at http://oss.oracle.com/licenses/upl. """ Module containing migrate platform system tools. """ import ipaddress import logging import os import re import shuti...
# oci-utils # # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved. # Licensed under the Universal Permissive License v 1.0 as shown # at http://oss.oracle.com/licenses/upl. """ Module containing migrate platform system tools. """ import ipaddress import logging import os import re import shuti...
en
0.608291
# oci-utils # # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved. # Licensed under the Universal Permissive License v 1.0 as shown # at http://oss.oracle.com/licenses/upl. Module containing migrate platform system tools. Backup a directory as path/bck_directory_name_[current_time] Paramet...
1.940619
2
graphAA.py
gwiedeman/aaText
3
6629094
import os import json import argparse import sys from nltk.tokenize import word_tokenize import nltk import matplotlib.pyplot as plt argParse = argparse.ArgumentParser() argParse.add_argument("-n", help="Phase(s) to graph, different versions separated by a pipe (|). Accepts multiple args.", action='append') argParse....
import os import json import argparse import sys from nltk.tokenize import word_tokenize import nltk import matplotlib.pyplot as plt argParse = argparse.ArgumentParser() argParse.add_argument("-n", help="Phase(s) to graph, different versions separated by a pipe (|). Accepts multiple args.", action='append') argParse....
ru
0.208019
#print (phrase + ": " + str(matchCount)) #print (xLists)
3.263671
3
convert_cached_copy_to_feed.py
ClockworkNet/gsa-admin-toolkit
34
6629095
<filename>convert_cached_copy_to_feed.py #!/usr/bin/python2 # # Copyright 2007 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/li...
<filename>convert_cached_copy_to_feed.py #!/usr/bin/python2 # # Copyright 2007 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/li...
en
0.763648
#!/usr/bin/python2 # # Copyright 2007 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...
2.186936
2
nipype/pipeline/plugins/multiproc.py
effigies/nipype
0
6629096
<filename>nipype/pipeline/plugins/multiproc.py # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Parallel workflow execution via multiprocessing Support for child processes running as non-daemons based on http://stackoverflow.com/a/8963618/1183453 """ ...
<filename>nipype/pipeline/plugins/multiproc.py # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Parallel workflow execution via multiprocessing Support for child processes running as non-daemons based on http://stackoverflow.com/a/8963618/1183453 """ ...
en
0.771919
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: Parallel workflow execution via multiprocessing Support for child processes running as non-daemons based on http://stackoverflow.com/a/8963618/1183453 # Import packages # Init logger # Run node Function to...
2.242474
2
tests/test_state.py
gmr/aiorabbit
17
6629097
<reponame>gmr/aiorabbit<gh_stars>10-100 from aiorabbit import exceptions, state from . import testing STATE_FOO = 0x10 STATE_BAR = 0x11 STATE_BAZ = 0x12 class State(state.StateManager): STATE_MAP = { state.STATE_UNINITIALIZED: 'Uninitialized', state.STATE_EXCEPTION: 'Exception', STATE_FO...
from aiorabbit import exceptions, state from . import testing STATE_FOO = 0x10 STATE_BAR = 0x11 STATE_BAZ = 0x12 class State(state.StateManager): STATE_MAP = { state.STATE_UNINITIALIZED: 'Uninitialized', state.STATE_EXCEPTION: 'Exception', STATE_FOO: 'Foo', STATE_BAR: 'Bar', ...
none
1
2.439583
2
andromeda/modules/technical_support/models/__init__.py
sango09/andromeda_api_rest
1
6629098
from .support import * from .rating import *
from .support import * from .rating import *
none
1
1.072708
1
PycharmProjects/pythonexercicios/aula017/ex079.py
zmixtv1/cev-Python
0
6629099
''' valores = [] while True: valores.append(int(input("Digite um valor: "))) resp = str(input("Quer continuar[S/N]: ")).upper() if resp == "S": valores.append(int(input("Digite outro valor: "))) resp = str(input("Quer continuar[S/N]: ")).upper() else: break valores.sort() print(...
''' valores = [] while True: valores.append(int(input("Digite um valor: "))) resp = str(input("Quer continuar[S/N]: ")).upper() if resp == "S": valores.append(int(input("Digite outro valor: "))) resp = str(input("Quer continuar[S/N]: ")).upper() else: break valores.sort() print(...
pt
0.264351
valores = [] while True: valores.append(int(input("Digite um valor: "))) resp = str(input("Quer continuar[S/N]: ")).upper() if resp == "S": valores.append(int(input("Digite outro valor: "))) resp = str(input("Quer continuar[S/N]: ")).upper() else: break valores.sort() print(f"vo...
3.976855
4
convert_tf_checkpoint_to_pytorch.py
awesome-archive/CAIL2019
300
6629100
#!/usr/bin/python # coding: utf-8 import shutil from pytorch_pretrained_bert import convert_tf_checkpoint_to_pytorch BERT_MODEL_PATH = "models/chinese_L-12_H-768_A-12/" if __name__ == "__main__": convert_tf_checkpoint_to_pytorch.convert_tf_checkpoint_to_pytorch( BERT_MODEL_PATH + "bert_model.ckpt", ...
#!/usr/bin/python # coding: utf-8 import shutil from pytorch_pretrained_bert import convert_tf_checkpoint_to_pytorch BERT_MODEL_PATH = "models/chinese_L-12_H-768_A-12/" if __name__ == "__main__": convert_tf_checkpoint_to_pytorch.convert_tf_checkpoint_to_pytorch( BERT_MODEL_PATH + "bert_model.ckpt", ...
en
0.42926
#!/usr/bin/python # coding: utf-8
2.432376
2
client.py
alisonsandrade/covidometro-tk
1
6629101
import socket import threading import tkinter import tkinter.scrolledtext from tkinter import ttk from service.api import ApiService HOST = "127.0.0.1" PORT = 9091 class Client: def __init__(self, host, port): self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect((host,...
import socket import threading import tkinter import tkinter.scrolledtext from tkinter import ttk from service.api import ApiService HOST = "127.0.0.1" PORT = 9091 class Client: def __init__(self, host, port): self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect((host,...
pt
0.194248
# Menu principal # Combo dos Estados # self.comboBoxState.grid(column=0, row=1) # Combo das cidades # message = f"{self.input_area.get('1.0', 'end')}"
3.028019
3
tests/test_gradients_fdtd.py
kwadwo00/ceviche
111
6629102
<gh_stars>100-1000 import unittest import sys import autograd.numpy as npa import numpy as np from autograd import grad from autograd import checkpoint from copy import deepcopy, copy from time import time import sys sys.path.append('../ceviche') from ceviche import fdtd from ceviche.utils import grad_num from cevic...
import unittest import sys import autograd.numpy as npa import numpy as np from autograd import grad from autograd import checkpoint from copy import deepcopy, copy from time import time import sys sys.path.append('../ceviche') from ceviche import fdtd from ceviche.utils import grad_num from ceviche.jacobians import...
en
0.563832
# gradient error tolerance # maximum allowed ratio of || grad_num - grad_auto || vs. || grad_num || # numerical gradient step size Tests for Gradient Correctness # basic simulation parameters # source parameters # starting relative permittivity (random for debugging) Checks the test case: compares the norm ...
2.673536
3
build/lib/sgs/__init__.py
gpetrini/pySGS
0
6629103
from .sgs import SGS from . import series
from .sgs import SGS from . import series
none
1
1.038013
1
findatapy/timeseries/filter.py
DT021/findatapy
0
6629104
__author__ = 'saeedamen' # <NAME> # # Copyright 2016-2020 Cuemacro # # 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...
__author__ = 'saeedamen' # <NAME> # # Copyright 2016-2020 Cuemacro # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the # License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
en
0.622076
# <NAME> # # Copyright 2016-2020 Cuemacro # # 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.608312
3
docs/examples/testing/unit_with_provided_injection_test.py
mitsuhiko/nameko
3
6629105
<reponame>mitsuhiko/nameko """ Service unit testing best practice, with a provided injection. """ import pytest from sqlalchemy import Column, Integer, String, create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from nameko.rpc import rpc from nameko.contrib.s...
""" Service unit testing best practice, with a provided injection. """ import pytest from sqlalchemy import Column, Integer, String, create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from nameko.rpc import rpc from nameko.contrib.sqlalchemy import orm_sessio...
en
0.545259
Service unit testing best practice, with a provided injection. # ============================================================================= # Begin test # ============================================================================= # create sqlite database and session # create instance, providing the real session f...
2.700065
3
mysite/sensor_com/disk_info.py
martinloland/greenhouse
1
6629106
<reponame>martinloland/greenhouse<gh_stars>1-10 import ctypes import os import platform import sys def get_free_space_mb(dirname): """Return folder/drive free space (in megabytes).""" if platform.system() == 'Windows': free_bytes = ctypes.c_ulonglong(0) ctypes.windll.kernel32.GetDiskFr...
import ctypes import os import platform import sys def get_free_space_mb(dirname): """Return folder/drive free space (in megabytes).""" if platform.system() == 'Windows': free_bytes = ctypes.c_ulonglong(0) ctypes.windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(dirname), None, None...
en
0.465287
Return folder/drive free space (in megabytes).
2.941602
3
app/webauthn/__init__.py
onyxcherry/OnyxcherryOTP
1
6629107
from flask import Blueprint bp = Blueprint("webauthn", __name__) from app.webauthn import routes
from flask import Blueprint bp = Blueprint("webauthn", __name__) from app.webauthn import routes
none
1
1.491379
1
scripts/run_box3d_pixel.py
fredshentu/public_model_based_controller
0
6629108
<reponame>fredshentu/public_model_based_controller import os from rllab.baselines.gaussian_conv_baseline import GaussianConvBaseline from sandbox.rocky.tf.policies.conv_nn_policy import ConvNNPolicy from rllab.envs.normalized_env import normalize from rllab.algos.trpo import TRPO from rllab.misc.instrument import stub,...
import os from rllab.baselines.gaussian_conv_baseline import GaussianConvBaseline from sandbox.rocky.tf.policies.conv_nn_policy import ConvNNPolicy from rllab.envs.normalized_env import normalize from rllab.algos.trpo import TRPO from rllab.misc.instrument import stub, run_experiment_lite from sandbox.rocky.tf.envs.bas...
en
0.645149
# Param ranges
1.609636
2
pdm/cli/commands/build.py
nasyxx/pdm
0
6629109
import argparse from pdm.cli import actions from pdm.cli.commands.base import BaseCommand from pdm.cli.options import project_option, verbose_option from pdm.project import Project class Command(BaseCommand): """Build artifacts for distribution""" arguments = [verbose_option, project_option] def add_ar...
import argparse from pdm.cli import actions from pdm.cli.commands.base import BaseCommand from pdm.cli.options import project_option, verbose_option from pdm.project import Project class Command(BaseCommand): """Build artifacts for distribution""" arguments = [verbose_option, project_option] def add_ar...
en
0.781808
Build artifacts for distribution
2.302287
2
module3/evaluate_predictions.py
axel-sirota/build-automated-ml-azure
5
6629110
import pandas as pd data = pd.read_csv(filepath_or_buffer='../datasets/energy-pred.csv', names=['Date', 'TZ', 'City', 'Code', 'Load', 'Predicted'], skiprows=1) accuracy = 100*(1-abs(data['Load'] - data['Predicted'])/data['Load']) accuracy.dropna(inplace=True) print(accuracy.describe())
import pandas as pd data = pd.read_csv(filepath_or_buffer='../datasets/energy-pred.csv', names=['Date', 'TZ', 'City', 'Code', 'Load', 'Predicted'], skiprows=1) accuracy = 100*(1-abs(data['Load'] - data['Predicted'])/data['Load']) accuracy.dropna(inplace=True) print(accuracy.describe())
none
1
2.841729
3
example.py
wmp-game/engine
0
6629111
<reponame>wmp-game/engine<filename>example.py from engine import Engine import random def rnd_pos(): return (10*random.random(), 10*random.random()) class TeamA: def __init__(self): self.name = 'Team A' def warrior(self, battle): return battle.this.move_to(rnd_pos()) def mage(self, b...
from engine import Engine import random def rnd_pos(): return (10*random.random(), 10*random.random()) class TeamA: def __init__(self): self.name = 'Team A' def warrior(self, battle): return battle.this.move_to(rnd_pos()) def mage(self, battle): return battle.this.move_to(rnd...
none
1
2.913613
3
nitro/resource/config/network/ipv6.py
HanseMerkur/nitro-python
2
6629112
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
en
0.754842
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
1.995015
2
graph/load_sigvisa_graph.py
davmre/sigvisa
0
6629113
<filename>graph/load_sigvisa_graph.py import time import numpy as np import os from sigvisa import Sigvisa from sigvisa.database.dataset import read_timerange, read_events, EV_MB_COL, EV_EVID_COL from sigvisa.database.signal_data import read_fitting_run_iterations from sigvisa.graph.sigvisa_graph import SigvisaGraph, ...
<filename>graph/load_sigvisa_graph.py import time import numpy as np import os from sigvisa import Sigvisa from sigvisa.database.dataset import read_timerange, read_events, EV_MB_COL, EV_EVID_COL from sigvisa.database.signal_data import read_fitting_run_iterations from sigvisa.graph.sigvisa_graph import SigvisaGraph, ...
en
0.616662
#wave = load_event_station_chan(fit[1], fit[2], fit[3], cursor=cursor, exclude_other_evs=True).filter('%s;env;smooth_%d;hz_%.2f' % (fit[4], fit[6], fit[5])) # inference is based on segments from all specified stations, # starting at the min predicted arrival time (for the true event) # minus 60s, and ending at the max ...
2.09215
2
application.py
Jason-Gew/BLE-Beacon-Tracking-System
19
6629114
<gh_stars>10-100 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Bluetooth LE Beacon Tracking Client Main Entry # Support Multiple Beacon Scan Mode, Frequency __author__ = 'Jason/GeW' __version__ = '2.0.0' import json import time import queue import threading import command_parser import beacon_scanner from app_logg...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Bluetooth LE Beacon Tracking Client Main Entry # Support Multiple Beacon Scan Mode, Frequency __author__ = 'Jason/GeW' __version__ = '2.0.0' import json import time import queue import threading import command_parser import beacon_scanner from app_logger import Logger ...
en
0.558243
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Bluetooth LE Beacon Tracking Client Main Entry # Support Multiple Beacon Scan Mode, Frequency # -------- Static Variables Start -------- # Max Beacon Scan Period (Unit: Second) # Max Single Beacon Scan Duration (Unit: Second) # -------- Static Variables End -------- Comm...
2.387289
2
sims/cb/cytofpy/attempt3/main.py
luiarthur/cytof5
1
6629115
<reponame>luiarthur/cytof5<gh_stars>1-10 import os import torch from readCB import readCB from Cytof import Cytof from simdata import simdata from torch.distributions import Normal import math import matplotlib.pyplot as plt import copy import numpy as np import pickle def add_gridlines_Z(Z): J, K = Z.shape fo...
import os import torch from readCB import readCB from Cytof import Cytof from simdata import simdata from torch.distributions import Normal import math import matplotlib.pyplot as plt import copy import numpy as np import pickle def add_gridlines_Z(Z): J, K = Z.shape for j in range(J): plt.axhline(y=j+...
en
0.362639
# SIMULATE_DATA = False # FIXME: missing values should be imputed # data = simdata(N=[30000, 10000, 20000], L0=3, L1=3, J=12, K=4) # data = simdata(N=[3000, 3000, 3000], L0=3, L1=3, J=12, K=4) # Plot yi # Save output # out = pickle.load(open('{}/out.p'.format(path_to_exp_results), 'rb')) # print(params) # for key in vp...
2.099497
2
modelo.py
raquellecampos/Python
0
6629116
<filename>modelo.py class Pessoa: def __init__(self, cpf, nome, data_nascimento, usa_oculos): self.cpf = cpf self.nome = nome self.data_nascimento = data_nascimento self.usa_oculos = usa_oculos class Marca: def __init__(self, nome, sigla): self.id = None self.nom...
<filename>modelo.py class Pessoa: def __init__(self, cpf, nome, data_nascimento, usa_oculos): self.cpf = cpf self.nome = nome self.data_nascimento = data_nascimento self.usa_oculos = usa_oculos class Marca: def __init__(self, nome, sigla): self.id = None self.nom...
none
1
2.869056
3
df_17/ct/transaction.py
tivvit/crypto_trading_bot_devfest_2017
0
6629117
import json from .trade_decider import TradeDirection class Transaction(object): def __init__(self, direction: TradeDirection) -> None: self.direction = direction def __repr__(self) -> str: return json.dumps({ "direction": self.direction, })
import json from .trade_decider import TradeDirection class Transaction(object): def __init__(self, direction: TradeDirection) -> None: self.direction = direction def __repr__(self) -> str: return json.dumps({ "direction": self.direction, })
none
1
2.653033
3
leetcode/python/925_long_pressed_name.py
VVKot/leetcode-solutions
4
6629118
class Solution: def isLongPressedName(self, name: str, typed: str) -> bool: i = 0 N = len(name) T = len(typed) for j in range(T): if i < N and name[i] == typed[j]: i += 1 elif not j or typed[j] != typed[j-1]: return False ...
class Solution: def isLongPressedName(self, name: str, typed: str) -> bool: i = 0 N = len(name) T = len(typed) for j in range(T): if i < N and name[i] == typed[j]: i += 1 elif not j or typed[j] != typed[j-1]: return False ...
none
1
3.33039
3
examples/3- minting tokens/main.py
0xOmarA/RadixLib
32
6629119
""" This example follows off right where the previous example (2- creating a new mutable supply token) left off. The last thing which we had done in the previous example is that we created a new mutable supply token. The created token had an rri of `<KEY>`. Keep in mind that the token that you create will have a dif...
""" This example follows off right where the previous example (2- creating a new mutable supply token) left off. The last thing which we had done in the previous example is that we created a new mutable supply token. The created token had an rri of `<KEY>`. Keep in mind that the token that you create will have a dif...
en
0.884907
This example follows off right where the previous example (2- creating a new mutable supply token) left off. The last thing which we had done in the previous example is that we created a new mutable supply token. The created token had an rri of `<KEY>`. Keep in mind that the token that you create will have a differe...
3.495559
3
tests/hwsim/hwsim.py
bjackman/hostap
1,104
6629120
# # HWSIM generic netlink controller code # Copyright (c) 2014 Intel Corporation # # Author: <NAME> <<EMAIL>> # # This software may be distributed under the terms of the BSD license. # See README for more details. import netlink, os # constants HWSIM_CMD_CREATE_RADIO = 4 HWSIM_CMD_DESTROY_RADIO = 5 HWSIM_ATTR_CHANNE...
# # HWSIM generic netlink controller code # Copyright (c) 2014 Intel Corporation # # Author: <NAME> <<EMAIL>> # # This software may be distributed under the terms of the BSD license. # See README for more details. import netlink, os # constants HWSIM_CMD_CREATE_RADIO = 4 HWSIM_CMD_DESTROY_RADIO = 5 HWSIM_ATTR_CHANNE...
en
0.675432
# # HWSIM generic netlink controller code # Copyright (c) 2014 Intel Corporation # # Author: <NAME> <<EMAIL>> # # This software may be distributed under the terms of the BSD license. # See README for more details. # constants # the controller class
2.212451
2
ksz_power/parameters.py
adeliegorce/tools4reionisation
0
6629121
import numpy as np from astropy import cosmology, units, constants ####################################### ########### System settings ########### ####################################### n_threads = 1 folder = './' outroot = folder+"/kSZ_power_spectrum" # root of all output files debug = True late_time = True #if you...
import numpy as np from astropy import cosmology, units, constants ####################################### ########### System settings ########### ####################################### n_threads = 1 folder = './' outroot = folder+"/kSZ_power_spectrum" # root of all output files debug = True late_time = True #if you...
de
0.457448
####################################### ########### System settings ########### ####################################### # root of all output files #if you want to compute the late-time component of the kSZ too ########################## #### Cosmo parameters #### ########################## #kg #kg m-3 # m-3 #K ########...
2.14729
2
tests/fullscale/eqinfo/test_eqinfo.py
cehanagan/pylith
93
6629122
#!/usr/bin/env nemesis # # ====================================================================== # # <NAME>, U.S. Geological Survey # <NAME>, GNS Science # <NAME>, University at Buffalo # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://geodynamics.org). # # Copyright (c)...
#!/usr/bin/env nemesis # # ====================================================================== # # <NAME>, U.S. Geological Survey # <NAME>, GNS Science # <NAME>, University at Buffalo # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://geodynamics.org). # # Copyright (c)...
en
0.641376
#!/usr/bin/env nemesis # # ====================================================================== # # <NAME>, U.S. Geological Survey # <NAME>, GNS Science # <NAME>, University at Buffalo # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://geodynamics.org). # # Copyright (c)...
2.438053
2
napari/_qt/utils.py
MaksHess/napari
7
6629123
<reponame>MaksHess/napari from __future__ import annotations import re import signal import socket import weakref from contextlib import contextmanager from functools import lru_cache, partial from typing import Sequence, Union import numpy as np import qtpy from qtpy.QtCore import ( QByteArray, QObject, ...
from __future__ import annotations import re import signal import socket import weakref from contextlib import contextmanager from functools import lru_cache, partial from typing import Sequence, Union import numpy as np import qtpy from qtpy.QtCore import ( QByteArray, QObject, QPoint, QPropertyAnima...
en
0.752787
Check if a string is a QByteArray string. Parameters ---------- string : bool State string. Convert a window state to a string. Used for restoring the state of the main window. Parameters ---------- qbyte : QByteArray State array. Convert a string to a QbyteArray. Use...
1.999112
2
ortools/linear_solver/samples/integer_programming_example.py
klorel/or-tools
1
6629124
<reponame>klorel/or-tools # Copyright 2010-2018 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 l...
# Copyright 2010-2018 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 agreed to in writing...
en
0.792805
# Copyright 2010-2018 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 agreed to in writing...
2.65247
3
easyga.py
eromid/easyGA-python
0
6629125
#!/usr/bin/env python # encoding: utf-8 """ EasyGA Copyright © 2017 Eromid (Olly) 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 rights to ...
#!/usr/bin/env python # encoding: utf-8 """ EasyGA Copyright © 2017 Eromid (Olly) 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 rights to ...
en
0.800952
#!/usr/bin/env python # encoding: utf-8 EasyGA Copyright © 2017 Eromid (Olly) 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 rights to use, ...
2.09693
2
webex_bot/websockets/webex_websocket_client.py
jseynaev-cisco/webex_bot
0
6629126
import asyncio import json import logging import socket import uuid import backoff import requests import websockets from webexteamssdk import WebexTeamsAPI DEFAULT_DEVICE_URL = "https://wdm-a.wbx2.com/wdm/api/v1" DEVICE_DATA = { "deviceName": "pywebsocket-client", "deviceType": "DESKTOP", "localizedMode...
import asyncio import json import logging import socket import uuid import backoff import requests import websockets from webexteamssdk import WebexTeamsAPI DEFAULT_DEVICE_URL = "https://wdm-a.wbx2.com/wdm/api/v1" DEVICE_DATA = { "deviceName": "pywebsocket-client", "deviceType": "DESKTOP", "localizedMode...
en
0.677663
Handle websocket data. :param msg: The raw websocket message # ack message first # Now process it with the handler # ack message first # Now process it with the handler In order to geo-locate the correct DC to fetch the message from, you need to use the base64 Id of the message. @param activity:...
2.47371
2
src/am_softmax.py
tenggyut/facenet
0
6629127
#encoding=utf8 import tensorflow as tf def am_logits_compute(embeddings, label_batch, fc_dim, nrof_classes): ''' loss head proposed in paper:<Additive Margin Softmax for Face Verification> link: https://arxiv.org/abs/1801.05599 embeddings : normalized embedding layer of Facenet, it's normalized value...
#encoding=utf8 import tensorflow as tf def am_logits_compute(embeddings, label_batch, fc_dim, nrof_classes): ''' loss head proposed in paper:<Additive Margin Softmax for Face Verification> link: https://arxiv.org/abs/1801.05599 embeddings : normalized embedding layer of Facenet, it's normalized value...
en
0.67594
#encoding=utf8 loss head proposed in paper:<Additive Margin Softmax for Face Verification> link: https://arxiv.org/abs/1801.05599 embeddings : normalized embedding layer of Facenet, it's normalized value of output of resface label_batch : ground truth label of current training batch args: argum...
2.675555
3
alipay/aop/api/response/AlipayBossFncInvoiceMailinfoQueryResponse.py
antopen/alipay-sdk-python-all
213
6629128
<reponame>antopen/alipay-sdk-python-all #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayBossFncInvoiceMailinfoQueryResponse(AlipayResponse): def __init__(self): super(AlipayBossFncInvoiceMailinfoQueryResponse, self)....
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayBossFncInvoiceMailinfoQueryResponse(AlipayResponse): def __init__(self): super(AlipayBossFncInvoiceMailinfoQueryResponse, self).__init__() self._creator = None ...
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
1.940315
2
src/pretix/base/migrations/0022_merge.py
pajowu/pretix
1,248
6629129
<gh_stars>1000+ # -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-04-23 09:44 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('pretixbase', '0020_auto_20160421_1943'), ('pretixbase', '0021_auto_20160418_2...
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-04-23 09:44 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('pretixbase', '0020_auto_20160421_1943'), ('pretixbase', '0021_auto_20160418_2117'), ] ...
en
0.795388
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-04-23 09:44
1.302242
1
s100py/s102/utils.py
GlenRice-NOAA/s100py
0
6629130
""" Functions to create S102 data from other sources """ import logging import sys import warnings import numpy from osgeo import gdal, osr from ..s1xx import s1xx_sequence from .api import DEPTH, UNCERTAINTY, S102File, S102Exception # @todo create a friendly name mapping to s102 nested location, then add s102 fun...
""" Functions to create S102 data from other sources """ import logging import sys import warnings import numpy from osgeo import gdal, osr from ..s1xx import s1xx_sequence from .api import DEPTH, UNCERTAINTY, S102File, S102Exception # @todo create a friendly name mapping to s102 nested location, then add s102 fun...
en
0.734771
Functions to create S102 data from other sources # @todo create a friendly name mapping to s102 nested location, then add s102 functions for "to dictionary" and "from dictionary" to api # that would make these functions easily invertable Small helper function to convert the output_file parameter into a S102File, curren...
3.065223
3
tests/test_models/test_vanilla_resnet/test_vanilla_resnet.py
rahulgupta9202/ColossalAI
1
6629131
<reponame>rahulgupta9202/ColossalAI #!/usr/bin/env python # -*- encoding: utf-8 -*- import pytest import torch import torchvision.models as models from colossalai.builder import build_model NUM_CLS = 10 RESNET18 = dict( type='VanillaResNet', block_type='ResNetBasicBlock', layers=[2, 2, 2, 2], num_cl...
#!/usr/bin/env python # -*- encoding: utf-8 -*- import pytest import torch import torchvision.models as models from colossalai.builder import build_model NUM_CLS = 10 RESNET18 = dict( type='VanillaResNet', block_type='ResNetBasicBlock', layers=[2, 2, 2, 2], num_cls=NUM_CLS ) RESNET34 = dict( ty...
en
0.587766
#!/usr/bin/env python # -*- encoding: utf-8 -*- Compare colossal resnet with torchvision resnet # data # resnet 18 # resnet 34 # resnet 50 # resnet 101 # # resnet 152
2.358459
2
src/profiles/urls.py
speedlight/rblmonitor
4
6629132
from django.conf.urls import url from . import views app_name = 'profiles' urlpatterns = [ url(r'^me$', views.ShowProfile.as_view(), name='show_self'), url(r'^me/edit$', views.EditProfile.as_view(), name='edit_self'), url(r'^(?P<slug>[\w\-]+)$', views.ShowProfile.as_view(), name='show'), ]
from django.conf.urls import url from . import views app_name = 'profiles' urlpatterns = [ url(r'^me$', views.ShowProfile.as_view(), name='show_self'), url(r'^me/edit$', views.EditProfile.as_view(), name='edit_self'), url(r'^(?P<slug>[\w\-]+)$', views.ShowProfile.as_view(), name='show'), ]
none
1
1.714605
2
parser/fase2/team14/CodigoIntermedio.py
Yosoyfr/tytus
0
6629133
import gramatica2 as g from storageManager import jsonMode from Expresion.variablesestaticas import variables from tkinter import * class CodigoIntermedio(): def __init__(self,entorno): self.entorno=entorno jsonMode.dropAll() variables.consola.delete("1.0", "end") variables.consola...
import gramatica2 as g from storageManager import jsonMode from Expresion.variablesestaticas import variables from tkinter import * class CodigoIntermedio(): def __init__(self,entorno): self.entorno=entorno jsonMode.dropAll() variables.consola.delete("1.0", "end") variables.consola...
none
1
2.865345
3
kstaretappipig/NTupleMaker_MagUp.py
Williams224/davinci-scripts
0
6629134
<gh_stars>0 from Gaudi.Configuration import * from Configurables import DaVinci #from Configurables import AlgTool from Configurables import GaudiSequencer MySequencer = GaudiSequencer('Sequence') #For 2012 MC DaVinci.DDDBtag='dddb-20130929-1' DaVinci.CondDBtag='sim-20130522-1-vc-mu100' #for 2011 MC #DaVinci.DDDBtag='...
from Gaudi.Configuration import * from Configurables import DaVinci #from Configurables import AlgTool from Configurables import GaudiSequencer MySequencer = GaudiSequencer('Sequence') #For 2012 MC DaVinci.DDDBtag='dddb-20130929-1' DaVinci.CondDBtag='sim-20130522-1-vc-mu100' #for 2011 MC #DaVinci.DDDBtag='dddb-2013092...
fr
0.409412
#from Configurables import AlgTool #For 2012 MC #for 2011 MC #DaVinci.DDDBtag='dddb-20130929' #DaVinci.CondDBtag='sim-20130522-vc-mu100' ################################################################# #Rerun with stripping21 applied ##################Creating NTuples##################################### # , "TupleToo...
2.145838
2
os_module/return_dir_subdir.py
marioymario/scripts
0
6629135
import os os.listdir("scripts") # file that we will be reading dir = "scripts" for name in os.listdir(dir): fullname = os.path.join(dir, name)#using os.path.join, we join the directory to each of those file names and create a String with a valid full name. if os.path.isdir(fullname): print("{} is a DIR...
import os os.listdir("scripts") # file that we will be reading dir = "scripts" for name in os.listdir(dir): fullname = os.path.join(dir, name)#using os.path.join, we join the directory to each of those file names and create a String with a valid full name. if os.path.isdir(fullname): print("{} is a DIR...
en
0.821538
# file that we will be reading #using os.path.join, we join the directory to each of those file names and create a String with a valid full name. What's the purpose of the os.path.join function? It creates a string containing cross-platform concatenated directories.
4.137284
4
alephnull/data/benchmarks.py
flatM/AlephNull
234
6629136
<gh_stars>100-1000 # # Copyright 2013 Quantopian, 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...
# # Copyright 2013 Quantopian, 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 wr...
en
0.701195
# # Copyright 2013 Quantopian, 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 wr...
2.235787
2
StoneAgeGUI.py
TheGameBotYT/StoneAgeAI
8
6629137
from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.image import Image from kivy.uix.label import Label from kivy.uix.button import Button from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.vector import Vector from kivy.clock import Clock from k...
from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.image import Image from kivy.uix.label import Label from kivy.uix.button import Button from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.vector import Vector from kivy.clock import Clock from k...
en
0.77723
# Adding Meeple Image widgets # Adding button widgets Skeleton for Stone Age GUI update widget. On a GUI update call needs to check AI or player If AI: 'Play a turn' using policy Elif Player: While no touch: pass If touch: ...
2.655882
3
testing_support/gerrit_test_case.py
stdft112/depot_tools
2,151
6629138
<filename>testing_support/gerrit_test_case.py # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Test framework for code that interacts with gerrit. class GerritTestCase ---------------------------...
<filename>testing_support/gerrit_test_case.py # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Test framework for code that interacts with gerrit. class GerritTestCase ---------------------------...
en
0.762643
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Test framework for code that interacts with gerrit. class GerritTestCase -----------------------------------------------------------------------------...
2.253011
2
ledgercomm/interfaces/tcp_client.py
LedgerHQ/ledgercomm
3
6629139
"""ledgercomm.interfaces.tcp_client module.""" import socket from typing import Tuple from ledgercomm.interfaces.comm import Comm from ledgercomm.log import LOG class TCPClient(Comm): """TCPClient class. Mainly used to connect to the TCP server of the Speculos emulator. Parameters ---------- s...
"""ledgercomm.interfaces.tcp_client module.""" import socket from typing import Tuple from ledgercomm.interfaces.comm import Comm from ledgercomm.log import LOG class TCPClient(Comm): """TCPClient class. Mainly used to connect to the TCP server of the Speculos emulator. Parameters ---------- s...
en
0.581498
ledgercomm.interfaces.tcp_client module. TCPClient class. Mainly used to connect to the TCP server of the Speculos emulator. Parameters ---------- server : str IP address of the TCP server. port : int Port of the TCP server. Attributes ---------- server : str I...
3.272391
3
tools/yaml_to_json.py
RatkoD/avid-covider
23
6629140
<filename>tools/yaml_to_json.py import os import re from pathlib import Path from hashlib import md5 from slugify import slugify import glob import yaml import json import requests PROJECT = 'avid-covider' def calc_hash(s): ret = md5(s.encode('utf8')).hexdigest()[:10] return ret HEB = re.compile('[א-ת]') def...
<filename>tools/yaml_to_json.py import os import re from pathlib import Path from hashlib import md5 from slugify import slugify import glob import yaml import json import requests PROJECT = 'avid-covider' def calc_hash(s): ret = md5(s.encode('utf8')).hexdigest()[:10] return ret HEB = re.compile('[א-ת]') def...
en
0.288607
# else: # print('KEY NOT IN TX %s'% key) BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN METHOD:PUBLISH CALSCALE:GREGORIAN BEGIN:VTIMEZONE TZID:Asia/Jerusalem TZURL:http://tzurl.org/zoneinfo-outlook/Asia/Jerusalem X-LIC-LOCATION:Asia/Jerusalem BEGIN:DAYLIGHT TZOFFSETFROM:+0200 ...
2.511051
3
scenes/website/control/scene_checkinlist.py
pretix/pretix-screenshots
14
6629141
import random from datetime import timedelta import faker import pytest from decimal import Decimal from django.utils.timezone import now from django.utils.translation import gettext as _ from pretix.base.models import Order from ...utils import screenshot @pytest.fixture def items(event, tax_rule): i1 = event....
import random from datetime import timedelta import faker import pytest from decimal import Decimal from django.utils.timezone import now from django.utils.translation import gettext as _ from pretix.base.models import Order from ...utils import screenshot @pytest.fixture def items(event, tax_rule): i1 = event....
none
1
1.91162
2
paip/examples/eliza/eliza.py
skynetshrugged/paip-python
0
6629142
<filename>paip/examples/eliza/eliza.py import json import sys import eliza rules = { "?*x hello ?*y": [ "How do you do. Please state your problem." ], "?*x computer ?*y": [ "Do computers worry you?", "What do you think about machines?", "Why do you mention computers?", ...
<filename>paip/examples/eliza/eliza.py import json import sys import eliza rules = { "?*x hello ?*y": [ "How do you do. Please state your problem." ], "?*x computer ?*y": [ "Do computers worry you?", "What do you think about machines?", "Why do you mention computers?", ...
en
0.510099
# We need the rules in a list containing elements of the following form: # `(input pattern, [output pattern 1, output pattern 2, ...]` # Remove the punctuation from the pattern to simplify matching. #pattern = eliza.translate(str(pattern.upper())) # kill unicode #eliza.interact('ELIZA> ', rules_list, map(str.upper, def...
2.974891
3
adventofcode-python/adventofcode2019/day/09/09.py
salockhart/adventofcode2020
1
6629143
import fileinput from collections import defaultdict POSITION = 0 IMMEDIATE = 1 RELATIVE = 2 ADD = 1 MUL = 2 IN = 3 OUT = 4 JUMP_TRUE = 5 JUMP_FALSE = 6 LESS_THAN = 7 EQUALS = 8 ADD_RELATIVE_BASE = 9 HALT = 99 READ = 0 WRITE = 1 OPS = { ADD: (READ, READ, WRITE), MUL: (READ, READ, WRITE), IN: (WRITE,), ...
import fileinput from collections import defaultdict POSITION = 0 IMMEDIATE = 1 RELATIVE = 2 ADD = 1 MUL = 2 IN = 3 OUT = 4 JUMP_TRUE = 5 JUMP_FALSE = 6 LESS_THAN = 7 EQUALS = 8 ADD_RELATIVE_BASE = 9 HALT = 99 READ = 0 WRITE = 1 OPS = { ADD: (READ, READ, WRITE), MUL: (READ, READ, WRITE), IN: (WRITE,), ...
none
1
3.02779
3
pyrobolearn/states/robot_states/sensor_states.py
Pandinosaurus/pyrobolearn
2
6629144
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- """Define the various sensor states This includes notably the camera, contact, IMU, force/torque sensors and others. """ import copy from abc import ABCMeta import collections import numpy as np # from pyrobolearn.states.robot_states.robot_states import Ro...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Define the various sensor states This includes notably the camera, contact, IMU, force/torque sensors and others. """ import copy from abc import ABCMeta import collections import numpy as np # from pyrobolearn.states.robot_states.robot_states import RobotState from p...
en
0.864068
#!/usr/bin/env python # -*- coding: utf-8 -*- Define the various sensor states This includes notably the camera, contact, IMU, force/torque sensors and others. # from pyrobolearn.states.robot_states.robot_states import RobotState Sensor state (abstract class) Initialize the sensor state. Args: sen...
2.728798
3
dizoo/league_demo/league_demo_ppo_config.py
jayyoung0802/DI-engine
1
6629145
<filename>dizoo/league_demo/league_demo_ppo_config.py<gh_stars>1-10 from easydict import EasyDict from torch.nn.modules.activation import Threshold league_demo_ppo_config = dict( exp_name="league_demo_ppo", env=dict( collector_env_num=8, evaluator_env_num=10, n_evaluator_episode=100, ...
<filename>dizoo/league_demo/league_demo_ppo_config.py<gh_stars>1-10 from easydict import EasyDict from torch.nn.modules.activation import Threshold league_demo_ppo_config = dict( exp_name="league_demo_ppo", env=dict( collector_env_num=8, evaluator_env_num=10, n_evaluator_episode=100, ...
en
0.649144
# ['zero_sum', 'prisoner_dilemma'] # prisoner_dilemma # This config file can be executed by `dizoo/league_demo/league_demo_ppo_main.py`
1.738853
2
src/interledger/adapter/indy.py
SOFIE-project/interledger-asset-transfer
4
6629146
import json import pprint from indy import pool, ledger, wallet, did from indy.error import IndyError from .interfaces import Initiator from ..transfer import Transfer def print_log(value_color="", value_noncolor=""): """set the colors for text.""" HEADER = '\033[92m' ENDC = '\033[0m' print(HEADER +...
import json import pprint from indy import pool, ledger, wallet, did from indy.error import IndyError from .interfaces import Initiator from ..transfer import Transfer def print_log(value_color="", value_noncolor=""): """set the colors for text.""" HEADER = '\033[92m' ENDC = '\033[0m' print(HEADER +...
en
0.636962
set the colors for text. This provides the proper Hyperledger Indy client wrapper # intial status is False before all handlers are ready Indy implementation of the Initiator. Listen for entries of changes on the Hyperledger Indy ledger and generate transfers accordingly. :returns: The event transfer lists ...
2.169768
2
src/helper/gpa.py
JosephSalomon/GN-Core
1
6629147
<gh_stars>1-10 ###***********************************### ''' Grade Notifier File: gpa.py Author: <NAME> Core Maintainers: <NAME>, <NAME>, <NAME> Copyright: Copyright 2019, <NAME> License: MIT ''' ###***********************************### class GPA(): _term_gpa = 0 _cumulative_gpa = 0 def __init__(self, t...
###***********************************### ''' Grade Notifier File: gpa.py Author: <NAME> Core Maintainers: <NAME>, <NAME>, <NAME> Copyright: Copyright 2019, <NAME> License: MIT ''' ###***********************************### class GPA(): _term_gpa = 0 _cumulative_gpa = 0 def __init__(self, term_gpa=0, cumu...
en
0.414637
###***********************************### Grade Notifier File: gpa.py Author: <NAME> Core Maintainers: <NAME>, <NAME>, <NAME> Copyright: Copyright 2019, <NAME> License: MIT ###***********************************###
3.1737
3
dendropy/datamodel/treecollectionmodel.py
EnjoyLifeFund/macHighSierra-py36-pkgs
0
6629148
#! /usr/bin/env python ############################################################################## ## DendroPy Phylogenetic Computing Library. ## ## Copyright 2010-2015 <NAME> and <NAME>. ## All rights reserved. ## ## See "LICENSE.rst" for terms and conditions of usage. ## ## If you use this work or any portio...
#! /usr/bin/env python ############################################################################## ## DendroPy Phylogenetic Computing Library. ## ## Copyright 2010-2015 <NAME> and <NAME>. ## All rights reserved. ## ## See "LICENSE.rst" for terms and conditions of usage. ## ## If you use this work or any portio...
en
0.686529
#! /usr/bin/env python ############################################################################## ## DendroPy Phylogenetic Computing Library. ## ## Copyright 2010-2015 <NAME> and <NAME>. ## All rights reserved. ## ## See "LICENSE.rst" for terms and conditions of usage. ## ## If you use this work or any portion...
2.118647
2
src/models/xgboost_test_model.py
pkiage/credit-risk-modelling-tool
1
6629149
<filename>src/models/xgboost_test_model.py from models.util_test import make_tests_view xgboost_test_model = make_tests_view( "XGBoost", "Gradient Boosted Tree with XGBoost")
<filename>src/models/xgboost_test_model.py from models.util_test import make_tests_view xgboost_test_model = make_tests_view( "XGBoost", "Gradient Boosted Tree with XGBoost")
none
1
1.509562
2
nginx-fast-multi-setup.py
liquidmotiondzn/nginx-fast-multisetup
0
6629150
<reponame>liquidmotiondzn/nginx-fast-multisetup<gh_stars>0 print("////// Nginx Setup //////") print() print("requirements: nginx, certbot already setup") print("Input your Domain (ex. mydomain.com)") domain = str(input()) def get_domain(domain): print() print("-----NGINX part-----") print() p...
print("////// Nginx Setup //////") print() print("requirements: nginx, certbot already setup") print("Input your Domain (ex. mydomain.com)") domain = str(input()) def get_domain(domain): print() print("-----NGINX part-----") print() print("sudo mkdir -p /var/www/" + domain + "/html") pri...
none
1
2.707941
3